enrmpaga Posted March 26, 2008 Share Posted March 26, 2008 anyone know the command of vbCrLf (ASP, (VBScript)) in php?? Quote Link to comment https://forums.phpfreaks.com/topic/98045-vbcrlf-in-php/ Share on other sites More sharing options...
wildteen88 Posted March 26, 2008 Share Posted March 26, 2008 I don't have any VB/ASP programming background but what does that code do? EDIT: Sorry should of done my homework first. I believe the vbCrLf allows for a newline to be outputted. If thats the case then the PHP equivalent is the PHP_EOL constant, eg: echo 'Hello ' . PHP_EOL . ' World'; /* OUTPUT: Hello World */ Quote Link to comment https://forums.phpfreaks.com/topic/98045-vbcrlf-in-php/#findComment-501652 Share on other sites More sharing options...
Barand Posted March 26, 2008 Share Posted March 26, 2008 or you can use this to do the same thing echo "Hello\r\nWorld"; - inserts a carriagereturn/linefeed pair of characters between Hello and World Quote Link to comment https://forums.phpfreaks.com/topic/98045-vbcrlf-in-php/#findComment-501765 Share on other sites More sharing options...
enrmpaga Posted March 26, 2008 Author Share Posted March 26, 2008 um its not working. I'm attempting to to display a record from a database in a list format. Its displaying as a list just fine but just as just one list item. I want it to break line e.g. <ul> </li></li> </li></li> </li></li> </ul> at the moment its just displaying one <li> Quote Link to comment https://forums.phpfreaks.com/topic/98045-vbcrlf-in-php/#findComment-501773 Share on other sites More sharing options...
Barand Posted March 27, 2008 Share Posted March 27, 2008 So how does your last post relate to your original one? What, exactly, are you starting with? Quote Link to comment https://forums.phpfreaks.com/topic/98045-vbcrlf-in-php/#findComment-501779 Share on other sites More sharing options...
Barand Posted March 27, 2008 Share Posted March 27, 2008 do you mean <?php $str = "the cat\r\nsat\r\non the mat"; $arr = explode (PHP_EOL, $str); echo "<ul>\n"; foreach ($arr as $item) { echo "<li>$item</li>\n"; } echo "</ul>\n"; ?> --> <ul> <li>the cat</li> <li>sat</li> <li>on the mat</li> </ul> Quote Link to comment https://forums.phpfreaks.com/topic/98045-vbcrlf-in-php/#findComment-501789 Share on other sites More sharing options...
enrmpaga Posted March 27, 2008 Author Share Posted March 27, 2008 thats exaclty it Quote Link to comment https://forums.phpfreaks.com/topic/98045-vbcrlf-in-php/#findComment-502094 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.