- var_dump: documentation ( source)
- explode: documentation ( source)
<?php
// $aaa {} $aaa {}
// parse it into variables
// using php
// $aaa {} $aaa {} $text { color: red;} $xfkskhlf {}
$string = '$aaa {} $aaa {}';
var_dump(parseString($string));
function parseString($string)
{
$output = array();
//logic
$string = explode("}", $string);
foreach ($string as $key->$value) {
$output[$key] = $value;
}
return $output ;
}