tags:

views:

69

answers:

1

Hello I have a string in PHP

$string = "...................blah blah blah.................."

where the ......... are blank spaces (stackoverflow doesn't let me enter many blank spaces).

How do I remove this block of blank spaces before and after the "blah blah blah" text? "blah blah blah" is parsed data that changes.

Thank you.

+5  A: 

the function trim().

$string = '..............bla bla bla........'; // where . represents space before and after
$string = trim($string);
thephpdeveloper
Worked perfect, thanks.
David Willis
no problem David!
thephpdeveloper