Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

[Basic] Move a content, from database, to a php file



6:19 pm on Feb 14, 2012 (gmt 0)

5+ Year Member

Hi guys, i have a content in one of phpmyadmin field


the content is like this, its have two lines :

usually its called from a php file, using a variable, like this

[PHP]$#*$! = explode("\r\n", $text);[/PHP]

now i want to put the content, directly in the php file. This is working, to only put one line

[PHP]$#*$! = explode("\r\n", "text1");[/PHP]

But how is the right way to write both line? please help guys, i already tried these but no one works

[PHP]$#*$! = explode("\r\n", "text1", "text2");[/PHP]

[PHP]$#*$! = explode("\r\n", "text1, text2");[/PHP]

$#*$! = explode("\r\n", "text1");
$#*$! = explode("\r\n", "text2");

[PHP]$#*$! = explode("\r\n", "text1" AND "text2");[/PHP]

[PHP]$#*$! = explode("\r\n", "text1" . "text2");[/PHP]


8:21 pm on Feb 14, 2012 (gmt 0)

WebmasterWorld Administrator incredibill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

For starters, I would only use "\n" in the explode as unless you're only supporting Windows as I don't believe the "\r" is always present.

You can use trim per array element to get rid of the "\r" and other white noise.

To get to the second line, after the explode, you need to use a foreach() or just address them individually line text[0], text[1], etc. unless I'm misunderstanding the question.

Hard to comment on the rest as your variable is being filtered in your sample, what was that again? Put spaces between the letters or something so we can see what it is.

Featured Threads

Hot Threads This Week

Hot Threads This Month