Jump to content

variable values containin $


rohithreddyk

Recommended Posts

Hi, in my class there is a member variable whose default value contains a "$" character in it.. like

private $name = "rohith$kodakandla"; 

 

if I use code like this, I am getting an "Unexpected '"' at line..." kind of error. I think the php is taking varible $name as rohith+ value of ( $kodakandla).. i tried removing $ () and It worked perfectly without error. but I want the $name to be "rohith$kodakandla"

 

can someone help me to fix this?

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/207508-variable-values-containin/
Share on other sites

thanks a lot barand and bh..

 

is this double quotes issue version dependent? the reason I am asking is, I came across this issue when debugging an old application that is no longer in use.. i am not sure which version of php they had.. but the current version I am using is 5.1.2

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.