Jump to content

adding text just before line feed, how?


mabog

Recommended Posts

I'm having trouble adding more tabs at the end of the line but BEFORE line feed.

I can find position of the line feed, but is there a function which can add text in string with position defined?

The string is like this:

"blaa\tblaa\t12345\tblaa\t*more tabs here*\n"

Link to comment
Share on other sites

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?

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.