I'm having a problem getting rid of newlines.
say I have this situation:
$cat = "A nice\n cat";
The "\n" is an escape character which creates a newline right there.
Now, how would I get rid of the newline in that string?
How would I then make that string: "A nice cat" ? without the newline
being there?
Also, another question.
If I have a string, let's say: "The man\nwent to the\tdairy\ryes terday"
Does anybody know of a function or of a way to display or find out the
escaped characters in the string? Something that would point out which
escaped characters were in the string?
The reason that I am asking is because I put a form on a web page and I
want to find out what escaped characters are in the resulting $_POST
variable for one of the fields, for a javascript reason.
Any help is much appreciated.
Nick
say I have this situation:
$cat = "A nice\n cat";
The "\n" is an escape character which creates a newline right there.
Now, how would I get rid of the newline in that string?
How would I then make that string: "A nice cat" ? without the newline
being there?
Also, another question.
If I have a string, let's say: "The man\nwent to the\tdairy\ryes terday"
Does anybody know of a function or of a way to display or find out the
escaped characters in the string? Something that would point out which
escaped characters were in the string?
The reason that I am asking is because I put a form on a web page and I
want to find out what escaped characters are in the resulting $_POST
variable for one of the fields, for a javascript reason.
Any help is much appreciated.
Nick
Comment