Please help me create a regular expression so that if $ a does not match "n, n, n, n," then 1 is output.
In this case, my regular expression will be true even if $ a = 1.5, b, d, e. And you just need to have only numbers.
$a = '1,5,'; if(!preg_match('/([0-9]+)\,/i', $a)) { echo 1; }