<?php $text = "name:value|name1:value1|name2:value2"; $result = ""; if (preg_match('~\bname2:([^|]*)~', $text, $m)) { $result = $m[1]; } echo $result;
You have javascript disabled. You will not be able to edit any code.