RE: Splitting string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> I think the easiest way, if you can guarantee exactly 50 spaces as
> the
> separator, is to simply explode() it.
> 
> $string = "EVOLUTION                                         DEAR
> GOD
> BOYZ_II_MEN                                       ";
> 
> $arr = explode(str_repeat(' ', 50), $string);
> 
> You could also use a regex, but that's probably overkill if your
> separator is
> that simple.  If it's not, then you may need a regex.
> 

Tried this ... and it returns $arr[0] as EVOLUTION DEAR GOD BOYZ_II_MEN ...
which in fact is wrong ... I would like ...;

	$arr[0] => EVOLUTION "word + spaces = 50 chars"
	$arr[1] => DEAR GOD "words + spaces = 50 chars"

Etc ... 

Steven

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux