Welcome Guest, Not a member yet? Register   Sign In
PHP strpos
#4

[eluser]BrianDHall[/eluser]
OOO, you just need AND - require that every test be false.

You can wrap it into a function, something like:

Code:
function check_url($strings)
{

if (! isarray($strings))
{
$strings[] = $strings;
}

foreach ($strings as $str)
{
if (strpos(cur_url(), $str) !== FALSE)
{
return false;
}
}

return true;
}

Then you can just pass one string or an array of strings and the function will return false if any of the strings are in the url, and true if it is clean of all unwanted items.


Messages In This Thread
PHP strpos - by El Forum - 01-01-2010, 12:06 PM
PHP strpos - by El Forum - 01-01-2010, 01:15 PM
PHP strpos - by El Forum - 01-01-2010, 01:22 PM
PHP strpos - by El Forum - 01-01-2010, 01:33 PM
PHP strpos - by El Forum - 01-01-2010, 01:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB