php - html_entity_decode make mystery manipulation with html-string -
have variable
$out = "<h4>edit user-bundle configuration</h4> <p> open file application/config/routes.php. here find: <pre>$route['default_controller'] = 'welcome'</pre> </p>"; when
html_entity_decode($out); now expect
<h4>edit user-bundle configuration</h4> <p> open file application/config /routes.php. here find: <pre>$route['default_controller'] = 'welcome'</pre> </p> but give out
<h4>edit user-bundle configuration</h4> <p> open file application/config/routes.php. here find: </p> <pre>$route['default_controller'] = 'welcome'</pre> <p></p>
you've misdiagnosed problem. php output code expect.
the code think outputs result of passing browser, rendering html , looking @ dom (instead of viewing source).
this because browser performing error recovery.
a <pre> element forbidden appearing inside <p> element. paragraphs may contain phrasing content (which not include <pre> elements).
you can see if skip php , go straight desired html:
<h4>edit user-bundle configuration</h4> <p> open file application/config /routes.php. here find: <pre>$route['default_controller'] = 'welcome'</pre> </p> screenshot of resulting dom, in chrome, above snippet:

Comments
Post a Comment