Is there an easier way to block things then ereg()?
Moderator: General Moderators
-
php_wiz_kid
- Forum Contributor
- Posts: 181
- Joined: Tue Jun 24, 2003 7:33 pm
Is there an easier way to block things then ereg()?
In my script I'm using ereg() to block certain number/symbols/letters when passed through an if statement so they don't get entered into a database. Now, I have super long lines of code using the ereg() function. Is there anyway I could put the unwanted numbers/symbols/letters in an external file and import them in so I don't have 150 ereg()'s in one if statement?
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
...
You could add them into an array and then check each letter to see if its in the array using:
in_array();
?>
in_array();
?>
-
php_wiz_kid
- Forum Contributor
- Posts: 181
- Joined: Tue Jun 24, 2003 7:33 pm
-
php_wiz_kid
- Forum Contributor
- Posts: 181
- Joined: Tue Jun 24, 2003 7:33 pm