$re = '~(?-s)("first_name".+)(\R)("id".+)~m';
$str = 'Пример:
"first_name": "Кристина",
"id": 535432535,
"last_name": "Сурикова",
"first_name": "Анастасия",
"id": 234532453,
"last_name": "Талызина",
"first_name": "Кристина",
"id": 2435325334,
"last_name": "Волкова",';
$subst = "$3$2$1";
$result = preg_replace($re, $subst, $str);
echo "The result of the substitution is ".$result;
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php