Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating new line as a delimiter 3

Status
Not open for further replies.

chineerat

Technical User
Oct 12, 2003
42
TT
hello!
i've been trying to create a string that starts "href" but delimited by a new line:
eg:

$link = strstr($fine, 'href')
$string = substr($link, 0, strpos($link,$new_line));

i have tried defining $new_line as:
$new_line = '\n';
$new_line = "\n";
$new_line = file_get_contents("new_line.txt");
where "new_line.txt" has a single new line.

nothing seems to work
am i doing something wrong ???
thanks in advance.


 
Try: $newline="\r\n";



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
yes, the \r\n is only intepreted as a carriage-return new-line when enclosed within double quotes.

there is a difference in php between single and double quotes that will trip you up again and again unless you read the manual.
 
excellent! thanks!
where is the manual by the way?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top