Jump to content

adding text just before line feed, how?


mabog

Recommended Posts

It (the linefeed) seems to be at the end of your string....

 

But i think that simplifies your problem too much?

 

$text="blaa\tblaa\t12345\tblaa\t*more tabs here*\n"
print substr($text,0,strlen($text)-1);
print "\t\t\t\t\t\t\t";

Thanks for the answers!

Actually problem was not \n, it was \r ...    ::)

Solved with this:

$exploded=explode("\r\n",$str); $str=$exploded[0]."\t\r";

 

But I'm curious why I can't put \n back? Like this:

$exploded=explode("\r\n",$str); $str=$exploded[0]."\t\r\n";

Doesn't work... but does it really need it?

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.