3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "code": "200002 - VALUE_TOO_LONG", "title": "Der von Ihnen gepflegte Wert ist zu lang. K\u00fcrzen Sie die den Wert entsprechend der Zeichenbegrenzung aus der API-Dokumentation.", "path": "\/products", "jsonPath": "$.productVariations[?(@.sku==\"506163\")].productDescription.bulletPoints" }'; $decode = json_decode($json, true); $re = '/\$..*\[.*].(.*)/m'; preg_match($re, $decode['jsonPath'], $matches); if (!empty($matches)) { $field = $matches[1]; } var_dump($field);

preferences:
62.17 ms | 402 KiB | 5 Q