drkscrt57 Posted August 21, 2006 Share Posted August 21, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/18238-html-tag-in-php-variable/ Share on other sites More sharing options...
Ninjakreborn Posted August 21, 2006 Share Posted August 21, 2006 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 //// Quote Link to comment https://forums.phpfreaks.com/topic/18238-html-tag-in-php-variable/#findComment-78280 Share on other sites More sharing options...
Jeremysr Posted August 21, 2006 Share Posted August 21, 2006 I don't think forward slashes have to be escaped, I think it's just the backslash (\) that has to be escaped... Quote Link to comment https://forums.phpfreaks.com/topic/18238-html-tag-in-php-variable/#findComment-78281 Share on other sites More sharing options...
drkscrt57 Posted August 21, 2006 Author Share Posted August 21, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/18238-html-tag-in-php-variable/#findComment-78282 Share on other sites More sharing options...
Jeremysr Posted August 21, 2006 Share Posted August 21, 2006 Maybe it has something to do with case-sensivity. Or maybe you should post your code? Quote Link to comment https://forums.phpfreaks.com/topic/18238-html-tag-in-php-variable/#findComment-78284 Share on other sites More sharing options...
T.Stedel Posted August 30, 2006 Share Posted August 30, 2006 I don't know if you still need help, but the backslash \ is the escape character, not the forward slash."<\/TR>" Quote Link to comment https://forums.phpfreaks.com/topic/18238-html-tag-in-php-variable/#findComment-83158 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.