I Have a Variable which contain following elements
$value= ' ["1","7.9","12\/01\/2015"] ';
Now I want to make a array so, that it will contain following values :-
$array[0] = 7.9;
$array[1] = 12/01/2015;
i want PHP Regex which can able to seprate the following element in the above manner. i tryed
$ans = preg_match('/^[0-9,]+$/', $value);
But this will not work. Plz Help what to do. to get the array with the above manner.
array[0] = 7.9; //amount
array[1]= 12/01/2015; //Date
1does the amount must have a decimal point?$value= " ["1","7.9","12\/01\/2015"] ";looks incorrect. Did you mean to enclose it in single quotes? You could possibly useexplodeif you want to separate a string by a delimiter