You are here: Re: Help with Smarty « PHP Programming Language « IT news, forums, messages
Re: Help with Smarty

Posted by Hal Rosser on 11/24/05 07:18

"Freebird" <peoplel@hotmail.com> wrote in message
news:dm318e$7vm$1@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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация