I have a sting, In that string, my array values are stored. How can I get array value from the string? Is there any predefined function in PHP or will achieve using REGEX?
$rule ="array(
array('parameter'=> 'signature name', 'values'=>'RNSOC023', 'condition'=>'EQUALS', 'rule type'=>'AND'),
array('parameter'=> 'DestinationZone', 'values'=>'l3-internet', 'condition'=>'EQUALS', 'rule type'=>'AND'),
array('parameter'=> 'Application', 'values'=>'ftp,sftp', 'condition'=>'EQUALS', 'rule type'=>'AND')
)";
if I do print_r($rule); it's giving string value only same as above. But I want output like
Array ( [0] => Array ( [parameter] => signature name [values] => RNSOC023 [condition] => EQUALS [rule type] => AND ) [1] => Array ( [parameter] => DestinationZone [values] => l3-internet [condition] => EQUALS [rule type] => AND ) [2] => Array ( [parameter] => Application [values] => ftp,sftp [condition] => EQUALS [rule type] => AND ) )
eval. But before going that direction: Where is the string coming from?"from $rule value.