Re: Re[2]: [PHP] doing with string
| From: | Jason Wong | Date: | Wed, 09 Apr 2003 11:55:13 +0000 |
| Subject: | Re: Re[2]: [PHP] doing with string | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143049@lists.php.net to get a copy of this message | ||
On Wednesday 09 April 2003 19:15, Artur Bereśniewicz wrote:
> Witam Burhan,
>
> Wednesday, April 9, 2003, 1:05:20 PM, napisałeś:
> > On Wed, 2003-04-09 at 05:52, Artur Bereśniewicz wrote:
> >> string "abc123efg456"
> >> array "abc","123","efg","456"
> >
> > Untested...
> >
> > $abc = "abc123efg456";
> > $bits = array();
> >
> > for ($x = 3; $x <= strlen($abc); $x = $x+3)
> > {
> > $bits[] = substr($abc,0,$x);
> > }
>
> Yes it could work if there always were triplets in the string. But
> there may be for example "a123ef456". There must by some kind of regular
> expression in it.
That is something you should've have noted in your original post. You should
define your problem clearly so that people need not waste time giving you
'incorrect' answers.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Bahdges? We don't need no stinkin' bahdges!
-- "The Treasure of Sierra Madre"
*/