>From the manual preg_split

Returns an array containing substrings of subject split along boundaries
matched by pattern.

since you dont have any borders, this is unlikely to help you....

the only was i can see to do it is a quite long way

$mydate = "20031202";
$date = array();
preg_match("/(\d{4})(\d{2})(\d{2})/", $mydate, $date);
list($x, $y, $d, $m) = $date;
echo $d." / ".$m." / ".$y ."\n";

Mike

On Tue, 2003-12-02 at 15:15, Tom wrote:
> I have noted the "'s.
> Could you send me a complete piece of code, please?
> I cannot for the life of me get it to work, at all.
> 
> Mike wrote:
> 
> >list ($a, $b, $c) = preg_split ("/(\d{4})(\d{2})(\d{2})/");
> >
> >note the "'s
> >
> >  
> >
> >>list ($a, $b, $c) = preg_split (/(\d{4})(\d{2})(\d{2})/);
> >> > parse error, unexpected '/', expecting ')'
> >>    
> >>
> >
> >  
> >
> 

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

Reply via email to