homepage Welcome to WebmasterWorld Guest from 54.81.170.186
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
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




msg:4610962
 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




msg:4611022
 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




msg:4611034
 7:04 pm on Sep 19, 2013 (gmt 0)

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

penders




msg:4611791
 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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved