473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with Smarty

Hello you all, =]
I've a smarty var, like this:
{$var}
that is equal to: ttttttttttttt|zzzzzzzzzzzz

It can be any size, the important is that they are separated by the '|'

How do I 'explode' that into an array or 2 variables in the smarty template
?

So I can just use:
{$var[0]} = ttttttttttttt;
{$var[0]} = zzzzzzzzzzzz;

Tks in advance

Freebird
Nov 24 '05 #1
2 4930

"Freebird" <pe*****@hotmail.com> wrote in message
news:dm**********@domitilla.aioe.org...
Hello you all, =]
I've a smarty var, like this:
{$var}
that is equal to: ttttttttttttt|zzzzzzzzzzzz

It can be any size, the important is that they are separated by the '|'

How do I 'explode' that into an array or 2 variables in the smarty template ?

So I can just use:
{$var[0]} = ttttttttttttt;
{$var[0]} = zzzzzzzzzzzz;

Tks in advance

Freebird


Try explode( ) like this:
$pizza = "piece1 piece2 piece3 piece4 piece5 piece6";
$pieces = explode(" ", $pizza);
echo $pieces[0]; // piece1
echo $pieces[1]; // piece2
*** reference: http://us2.php.net/manual/en/function.explode.php
Nov 24 '05 #2
HERE'S MY QUESTION:

I've a smarty var, like this:
{$var}
that is equal to: ttttttttttttt|zzzzzzzzzzzz

It can be any size, the important is that they are separated by the '|'

How do I 'explode' that into an array or 2 variables in the smarty template
?

So I can just use:
{$var[0]} = ttttttttttttt;
{$var[0]} = zzzzzzzzzzzz;
HERE'S YOUR ANSWER,

Try explode( ) like this:
$pizza = "piece1 piece2 piece3 piece4 piece5 piece6";
$pieces = explode(" ", $pizza);
echo $pieces[0]; // piece1
echo $pieces[1]; // piece2
*** reference: http://us2.php.net/manual/en/function.explode.php


DO YOU READ THE MESSAGES BEFORE YOU ANSWER THEM ?
DO YOU THINK I DON'T KNOW HOW TO USE EXPLODE ?
I WAS REALLY CLEAR, TAKE IT A LOOK AT THE QUESTION ABOVE, I NEED TO THAT
WITHIN SMARTY TEMPLATES, GET IT ?
INSIDE SMARTY TEMPLATES, SMARTY !
TKS
Freebird

Nov 24 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Brian | last post by:
Hello, I am trying to work out how to have smarty use a string's contents as the display-> template.. ie: $smarty->display($buffer); obviously $buffer isn't a filename, but a smarty template...
2
by: Daan | last post by:
Hello all, I'm having a little problem with Smarty. Getting it to work in a simple case went fine, but now I have the following situation: / /smarty /templates template.tpl /templates_c
2
by: M | last post by:
Hi Folks, I am trying to install Smarty using PHP 5 on a Windows XP PC using IIS v6 The following PHP File: <!doctype html public "-//W3C//DTD HTML 4.0 //EN"> <html> <head>
0
by: Matt | last post by:
geez, i've done this a million times, you'd think i could get it right. uploading to production server for a new site, and part of the head.inc that starts everything up looks like this: echo...
0
by: Conrad | last post by:
Hi, I'm very new to Smarty Template Engine and I'm using PHP 5.0.4 on the Windows XP Professional platform and I have the following question: When I change the 7th line of the script to use a...
12
by: bryan | last post by:
I've posted before but no one replied because I think it was confusing. My problem is that I have a website where users have profile pages, and they can each chooser their own (i.e. blogger.com)...
0
by: ev45ive | last post by:
Hi! I have smth. like this: file.php: <?php SmartyValidate::connect($smarty); //SmartyValidate::register_form('register');
0
by: grezlik | last post by:
Hi! I have major problems with cakephp & smarty, (cake ver is 1.2 and smarty 2.6.18 ) there is a code (from cake/libs/view/view.php class SmartyView { .. .. ..
1
by: ajaymohank | last post by:
hello friends.......... i am new to smarty. can anyone please tell me how to get the value from a dynamically generated checkbox using smarty. this is the code i used... here i am generating 10...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.