- var_dump: documentation ( source)
- preg_match: documentation ( source)
<?php
$error = array("property" => "", "message" => "the property whatever is required");
if (empty($error['property']) && preg_match("/is required$/", $error['message']) && preg_match("/the property (.+) is required/", $error['message'], $matches)) {
var_dump($matches);
}
else {
echo "haha";
}