<?php $str = "level :13,min_lvl:1,max_lvl :20,text :\"Priver Вова\",txt:'Я Бургер'"; $str = str_replace (array ("'", '"'), '', $str); preg_match_all ('/(\w+)\s*:\s*(.+?)(?:,|\Z)/', $str, $m); for ($i = 0; $i < count ($m[1]); $i++) ${$m[1][$i]} = $m[2][$i]; echo $txt, "\n"; ?>