Re: formating output

From: Date: Wed, 28 Feb 2001 15:16:45 +0000
Subject: Re: formating output
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-42033@lists.php.net to get a copy of this message
some code snipits would help, but lets see what we can do. I like arrays, they work for me, there are lots of ways todo things, arrays will help. echo "<b>{$headline[0]}</b><a href='{$newslink[0]}'>Latest news</a> blah blah<br> \n"; echo "<b>{$headline[1]}</b><a href='{$newslink[1]}'>Latest news</a> blah blah<br> \n"; echo "<b>{$headline[2]}</b><a href='{$newslink[2]}'>Latest news</a> blah blah<br> \n"; you can also accompish this nicer with a foreach loop foreach($headline as $pos => $val) echo "<b>{$headline[$pos]}</b><a href='{$newslink[$pos]}'>Latest news</a> blah blah<br> \n"; more info at http://php.net/manual/en/control-structures.foreach.php email me with more questions, I am eager to help -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 lee@mediawaveonline.com ""george"" <chiefmonkey@wisemonkeydesign.co.k> wrote in message news:97j42g$314$1@toye.p.sourceforge.net... I am developing a site which will have a web based admin panel, just now you can alter the scrolling headlines through the panel. But I want to be able to let the user modify, delete and create new headline, this isnt proble but i dong know how to format the output. What i want is for it to dispaly the headlines that are in the table be it 2 or 5 how do i take info from a table and get it to echo the code as many times as needed(dependingon the headlines in the table) so the code would be like this but how do i also stop it from displaying the same fields ie exact same headline link etc. and how do i get this so that 3 news stories = 3 lines code myScroller1.addItem("<b><? echo "$headline" ; ?><a href='<? echo "$newslink"; ?>'> latest news news</a>, news news news</b>"); Hope you understand it, I dont think i do. George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#42033) next »