View Single Post
Old 09-29-2009, 04:42 AM  
StariaDaniel
Confirmed User
 
Join Date: Oct 2007
Location: Netherlands
Posts: 415
first explode the string on every ;, next explode every array element on :

http://de.php.net/manual/en/function.explode.php

e.g.:

$tmp = 'description title:description text;description title2:description text2';
$tmp2 = explode(';',$tmp);

returns:

$tmp2[0] = 'description title:description text';
$tmp2[1] = 'description title2:description text2';

now you could do something like:
$tmp3 = array();
foreach($tmp2 AS $value){
$tmp3[] = explode(':',$value);
}

and you get

$tmp3[0] = array(
0 => 'description title',
1 => 'description text'
);
$tmp3[1] = array(
0 => 'description title2',
1 => 'description text2'
);
StariaDaniel is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote