Re: i need help

From: Date: Tue, 18 May 2004 16:53:13 +0000
Subject: Re: i need help
References: 1 2  Groups: php.windows 
Request: Send a blank email to php-windows+get-23763@lists.php.net to get a copy of this message
Jordi Canals wrote:
Student wrote:
I want to trim the following text [i:abcdef]
Hi, You can do: $data = '[i:something]'; $array_data = explode(':',$data); and you will have: '[i' in $array_data[0] 'something]' in $array_data[1] If i understod corretly, you want to get only something, so you need $array_data[1]. To take off brackets, just use str_replace(); Hoppe this helps, Jordi.
Or, better, you can do : preg_match( "/^\\[i\\:(.*)\\]\$/", "[i:something]", $matches ); $matches[1] will contain "something". Peter.

« previous php.windows (#23763) next »