Ryan Ryan - 1 year ago 80
PHP Question

Wrap unwrapped text in <span>


Unwrapped text

What i want:

<span>Unwrapped text</span>

How to achieve this without relying on new lines?

Answer Source

I would not use regular expressions for html.

You can do it with phpQuery

$doc = phpQuery::newDocument($html);
$html = $doc->html();

Didn't try it though.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download