Re: Get fields values from a string.
| From: | Cristian Lavaque | Date: | Sat, 11 Oct 2003 00:45:14 +0000 |
| Subject: | Re: Get fields values from a string. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-165814@lists.php.net to get a copy of this message | ||
yup
you could do something like this
$string = 'field_value1:field_value2:field_value3';
$array = explode(':', $str);
foreach($array as $substring){
list($field, $value) = explode('_', $substr);
$$field = $value;
}
hope this helps
Cristian
Mehdi Achour wrote:
> Hi,
>
> Check this : php.net/explode
>
> didou
>
>
> Carles Xavier Munyoz Baldó wrote:
>
>> Hi,
>> I have a string with the format:
>> "field_value1:field_value2:field_value3"
>>
>> Is there any PHP string manipulation function to extract this values
>> from the string ?
>>
>> Greetings.
>> ---
>> Carles Xavier Munyoz Baldó
>> carles@unlimitedmail.org
>> http://www.unlimitedmail.net/
>> ---