Re: i need help

From: Date: Tue, 18 May 2004 08:49:06 +0000
Subject: Re: i need help
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-23748@lists.php.net to get a copy of this message
Student wrote:
I want to trim the following text [i:abcdef] but the inside text is different at time eg abcdef, bcdefg, etc etc how can i trim [i:(some text here)] so that i can replace them with nothing. eg these are to be trimmed. [i:abcdef] [i:bcdefg] [i:xyzab] [i:priftds] how can i trim them.. 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.

« previous php.windows (#23748) next »