homepage Welcome to WebmasterWorld Guest from 54.166.113.249
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
weird error while concatenate string
skoff

5+ Year Member



 
Msg#: 4610960 posted 3:16 pm on Sep 19, 2013 (gmt 0)

here's my code :
$str = "";
foreach($arr as $r) {
$str .= '<option value="'.$r["idField"].'">'.$r["name"].'<option>';
}
echo $str;


i checked my array and its populated.
i've done this a million time... but there's no echo of it.. the only difference is that i use XAMPP on windows... normally i'm on linux. Is there any settings i need to change so it can work?

 

Readie

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4610960 posted 6:11 pm on Sep 19, 2013 (gmt 0)

Might be output buffering?

Try this:

echo $str;
flush();
if(ob_get_level() > 0) { ob_flush(); }

skoff

5+ Year Member



 
Msg#: 4610960 posted 7:04 pm on Sep 19, 2013 (gmt 0)

never thought of it.. i had special characters in some string.. thanks

penders

WebmasterWorld Senior Member penders us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



 
Msg#: 4610960 posted 2:06 pm on Sep 22, 2013 (gmt 0)

Just curious... what was the "weird error"? Or was it that it simply didn't work as expected (no error)?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved