Jump to content


Photo

Html Tag in Php Variable


  • Please log in to reply
5 replies to this topic

#1 drkscrt57

drkscrt57
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 21 August 2006 - 08:40 PM


I'm trying to get php to search a file for the closing row tags of an html table, I'm getting snagged when I try to save the tag as a variable:
$unique_end = "</TR>";

However it seems that the '/' is conflicting the string somehow. But when I add an escape command such as single quotes so that the line looks like this: $unique_end = "{<'/'TR>}" the single quotes get saved into the string. Can anybody help me get around the forward slash without including extra characters?

Thanks


#2 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 21 August 2006 - 08:42 PM

When you escape a string in mysql, for instance when you have the / symbolw hich is used to escape the character, if you want to escape the escape it's // then it said something about escaping the escape to the escape it's like //// to get that to escape right, by what i have read so try // if it doesn't work try ////

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#3 Jeremysr

Jeremysr
  • Members
  • PipPipPip
  • Advanced Member
  • 199 posts
  • LocationSaskatchewan, Canada

Posted 21 August 2006 - 08:43 PM

I don't think forward slashes have to be escaped, I think it's just the backslash (\) that has to be escaped...

#4 drkscrt57

drkscrt57
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 21 August 2006 - 08:46 PM

I tried doing the forward slashes both // and //// and it still doesnt work. And I didnt think that forward slashes needed to be escaped either... but for some reason it's not recognizing the string



#5 Jeremysr

Jeremysr
  • Members
  • PipPipPip
  • Advanced Member
  • 199 posts
  • LocationSaskatchewan, Canada

Posted 21 August 2006 - 08:52 PM

Maybe it has something to do with case-sensivity. Or maybe you should post your code?

#6 T.Stedel

T.Stedel
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 30 August 2006 - 09:59 PM

I don't know if you still need help, but the backslash \ is the escape character, not the forward slash.

"<\/TR>"




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users