general php problem - ereg question |
[eluser]skattabrain[/eluser]
OK, so i upgraded php and looks like ereg and ereg replace are gone! so i have some old code in there, in regards to checking credit cards. I don't know what 2nd condition is doing ... the !ereg('5[1-5]', $ccnum) Code: if ($type == 'mastercard')
[eluser]skattabrain[/eluser]
also ... i need a substitute for this ... Code: $in = ereg_replace("[^A-Za-z0-9 -.]", "", $in); my regex skills blow! i need to to basically string out anything that isn't alphanumeric
[eluser]skattabrain[/eluser]
[quote author="Phil Sturgeon" date="1267467940"]Don't use ereg, its deprecated in PHP 5.3.[/quote] Thanks Phil ... I see you haven't had your morning coffee? I upgraded PHP to the latest and yes, they are deprecated, I was trying to find a suitable replacement ... seeing my site was barfing some errors. Hey ... looks like your Pyro is coming of age? I need to check that out again later.
[eluser]Phil Sturgeon[/eluser]
It wasn't coffee I was lacking, just sugar. One large Sprite later and I'm ready to give a slightly more useful answer. This should help with most of it, but the the 2nd expression should be: Code: $in = preg_replace('/([^A-Za-z0-9 -.])+/', '', $in); |
Welcome Guest, Not a member yet? Register Sign In |