I have the following html entity codes:
$html = "<div id="sstssfb_aaa-theme_wrapper" class="first_sstform_wrapper"> <div class="bscon sstform_wrapper"> <div class="sst_formheaderbgr">"
I want to replace this string sstssfb_aaa-theme_wrapper with the new one using str_replace like so:
$num = 20;
$old = '#sstssfb_aaa-theme_wrapper';
$old = str_replace("#", "", $old);
$new = 'sstssfb_aaa-theme_wrapper' . $num;
$new_html = str_replace($old, $new, $html);
But it won't work at all and returning the original $html instead of the modified.
What would be the problem here and how to solve it?
EDIT:
It works after I trim the $old variable like this:
$old = trim(str_replace("#", "", $old));
str_replacedeclaration...$new_htmlcontains the replaced token.