Looking for any function that will search a string for 2 dots (..), and if the dots are inside the string, then it will result in an error.
[need more information? just ask]
if variable contains '..'
Moderator: General Moderators
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
Code: Select all
if(strstr($string, "..")){
// ERROR
}- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
If you don't need more complicated pattern matching then ereg() is uneccessary. Also strpos() may be a better function to use than strstr() for this particular test:
http://www.php.net/manual/en/function.strpos.php
http://www.php.net/manual/en/function.strstr.php
Mac
http://www.php.net/manual/en/function.strpos.php
http://www.php.net/manual/en/function.strstr.php
Mac
