If you need to do with regular expression the check the online script here
For general purpose:
You need to check the firstName
or lastName
is english or not, if not then store them in an array and at the end just implode them as the result demand.
$json = '{"employees":[
{"firstName":"John", "lastName":"Doe"},
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Вилен", "lastName":"Авангард"},
{"firstName":"Станислав", "lastName":"Андрей"}
]}';
$arr = json_decode($json, true);
$out = array();
foreach($arr['employees'] as $value){
if(strlen($value['firstName']) != mb_strlen($value['firstName'], 'utf-8'))
$out[] = $value['firstName'];
if(strlen($value['lastName']) != mb_strlen($value['lastName'], 'utf-8'))
$out[] = $value['lastName'];
}
echo implode(" ", $out); //Вилен Авангард Станислав Андрей
Note: You need mbstring php module installed.