Re: Split
| From: | Daniel Brown | Date: | Tue, 13 Dec 2011 20:36:52 +0000 |
| Subject: | Re: Split | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-315991@lists.php.net to get a copy of this message | ||
On Tue, Dec 13, 2011 at 15:33, Jack <JackListMail@gmail.com> wrote:
> OK so I have seen enough errors about split, so I decided to update my code:
>
> return split("/", $sPath, $iMax);
>
>
>
> I tried:
>
> return preg_split("/", $sPath, $iMax);
>
> return preg_split("/", $sPath, $iMax, PREG_SPLIT_DELIM_CAPTURE);
>
>
>
> and a few other combinations, in the end always with errors. not sure I get
> the additional aspect.
>
> I do see ther error log it tells me no ending delimiter
>
>
>
> Any help appreciated.
That's because those functions use regexp strings to split.
Besides, split() itself is deprecated as of 5.3. Instead, what you're
looking for is explode(). Give that a try and you should be good to
go.
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/