I’m trying to extract some values in an array based on them being alpha numeric or having an underscore. It is not working through. This is what I’m providing the script:
...
[183]=>
string(23) "/games/boomerang_devils"
[184]=>
string(26) "/games/krushuna_waterfalls"
[185]=>
string(21) "/games/super_drift_3d"
[186]=>
string(34) "/games/around_the_world_in_80_days"
[187]=>
string(24) "/games/governor_of_poker"
[188]=>
string(21) "/games/shoot_on_sight"
...
The code:
if (preg_match('/\/games\/[a-zA-Z0-9_]/', $array['item'])) {
// Add to DB
}
But it’s not picking it up. Can anyone spot what I’m doing wrong?
you need to repeat the character by adding
+