Re: Split problem...
| From: | Rob Curts | Date: | Thu, 20 Jul 2000 14:49:06 +0000 |
| Subject: | Re: Split problem... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7429@lists.php.net to get a copy of this message | ||
on 7/20/00 10:43 AM, Kasper (Swebase Network) at kasper@swebase.com wrote:
>
> Is it possible to split
>
> http://www.php.net
>
> so i only get
>
> php.net and not http://www. ???
>
> So i always just get the two last words???
>
>
> Med vänlig hälsning
> Kasper Kristiansson
> 042-217785, Fax 0703-831214
>
>
yes of course:
Since a "." is a reserved character for regular expressions, you need to
escape it in the split function.
<?
$v = "http://www.php.net/"
$a = split("\.",$v);
/* $a[0] will be "http://www" (no dot at the end) */
?>