Андрей Сердюк Андрей Сердюк - 1 year ago 157
PHP Question

Delete spaces php

I need delete all tags from string and make it without spaces.

I have string

"<span class="left_corner"> </span><span class="text">Adv</span><span class="right_corner"> </span>"

After using strip_tags I get string

" Adv "

Using trim function I can`t delete spaces.

JSON string looks like "\u00a0...\u00a0".

Help me please delete this spaces.

Answer Source

Solution of this problem

$str = trim($str, chr(0xC2).chr(0xA0))

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