NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Variables and escaped character


Joined: 20 Sep 2006
Posts: 59
Reply with quote
When in debug mode, I hover over a variable that has a string in it I get a lot of:

Hello\r\n\t\tworld!\r\n

Which is annoying. This also shows up in the globals and locals panel.

Also I write my SQL like:

$sql = <<<EOT

SELECT *
FROM table
WHERE id=$id

EOT;

When I then hover over $sql to see if my SQL is ok I get a ton of \r\n\t\t\t and if I go to the local tab and copy the contents of $sql then past the SQL into SQLyog (A MySQL front end) I get:

\t\t\tSELECT *\r\n\t\t\tFROM table\r\n\t\t\tWHERE it=12

which is really annoying. Why is it doing that weird escape thing with the text? How can I fix it?

monk.e.boy
View user's profileFind all posts by monkiesSend private message


Joined: 24 Oct 2006
Posts: 98
Location: Melbourne, AU
Reply with quote
I wouldn't consider it an error, as it's showing you the contents of the variable which, in your case is full of those control characters.

What do you get when the variable is assigned in a more conventional manner...
Code:

$sql = "
SELECT *
FROM table
WHERE id=$id";
View user's profileFind all posts by LatsSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
you may change string representation format from PHP to text either in Locals popup or in Globals one.
While in php format, it will always show non-printed characters escaped.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 20 Sep 2006
Posts: 59
Reply with quote
dmitri wrote:
you may change string representation format from PHP to text either in Locals popup or in Globals one.
While in php format, it will always show non-printed characters escaped.


Brilliant!!! Thank you soooooooo much!!!! This is ideal Wink Very Happy Smile Embarassed Razz Shocked Smile Surprised Laughing Exclamation Exclamation Twisted Evil Question Question Idea Very Happy

monk.e.boy
View user's profileFind all posts by monkiesSend private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
I think you missed a couple smilies Razz
View user's profileFind all posts by BlizzSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
perhaps, it's a good candidate for FAQ

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Variables and escaped character
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic