Jump to content

Archived

This topic is now archived and is closed to further replies.

drkscrt57

Html Tag in Php Variable

Recommended Posts


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

Share this post


Link to post
Share on other sites
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 ////

Share this post


Link to post
Share on other sites
I don't think forward slashes have to be escaped, I think it's just the backslash (\) that has to be escaped...

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Maybe it has something to do with case-sensivity. Or maybe you should post your code?

Share this post


Link to post
Share on other sites
I don't know if you still need help, but the backslash \ is the escape character, not the forward slash.

"<\/TR>"

Share this post


Link to post
Share on other sites

×

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.