You are here: Re: Adding line breaks to a variable dynamically « PHP Programming Language « IT news, forums, messages
Re: Adding line breaks to a variable dynamically

Posted by Geoff Berrow on 12/16/06 08:51

Message-ID: <6d57$45834eb3$8259c69c$4725@news2.tudelft.nl> from Rik
contained the following:

>> $array=explode(" ",$linestring);
>> for($i=0;$i<count($array);$i++){
>> echo(($i+1)%3===0)?$array[$i]." <br>\n":$array[$i]." ";
>> }
>
>Yup, for some reason I've decided I hate variable counters, don't know why
>:-). It doesn't hurt to try different methods either.
>
>Then again, your answer is flawed :P
>
>It's not three (or #n) words in a row, but an arbitrary amount of words
>split in #n rows.


You are right, I didn't read the whole problem. As usual I prove I am
not worthy... :-(
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

 

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

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