thank you but with <?PHP $text = array('a:1:{i:4;c:7;s:23:"fdgrtgr";}', 'a:1:{i:4;s:78:"ertertferf";}', 'a:1:{i:4;s:56:"sdferetrr";}', 'a:1:{i:8;s:22:"aajoimk";}', 'a:1:{i:4;s:19:"sdfasjk";}', 'a:1:{i:6;s:7:"cwam";}', 'a:1:{i:4;s:4:"serwerwer";}', 'a:1:{i:4;s:55:"rty56yr";}', 'a:1:{i:4;s:7:"easdsdas";}', 'a:1:{i:4;s:44:"jghjjh";}', 'a:1:{i:4;s:2;h:9::"erwer";}', 'a:1:{i:4;s:71:"gftyrt";}', 'a:1:{i:4;s:16:"ghjhj";});'); foreach ($text as $data) { preg_match('/(?:")([\w\d]+)(?:")/',$data,$match); echo "$match[1]\n"; } ?> works with an array but i want it to just work with one value at a time so $pies = 'a:1:{i:6;s:7:"cwam";}' and remove all the 'a:1:{i:6;s:7:"";}'s from $pies and then the script would do the same thing again with $pies = 'a:1:{i:4;s:71:"gftyrt";}'