My script extract span with it’s attributes. I want to replace span with attributes with something else. I am using following piece of code, maybe cause of special characters it doesn’t work.
$tag=strtolower(str_replace("'<<span_id="ctl00_cphpagecontant_label6"><b>'","B",$tag));
Nesting quotes, ya’ need to escape ’em mate!
If you have a string wrapped in
""and would like this string to contain a literal"you will need some sort of method to say that "hey, I want this character here – but it’s not the end of the string", that’s where escaping comes in.By prepending your character with a backslash
\you tell the PHP interpreter just that; this character is a part of the string, it’s not used to denote the end of it.Note: Does the string you’d like to replace start and end with
'? Otherwise those characters should be removed from the string.