Hello Coder Dan
I tried your snippet but received a parsing error as follows:-
Call to undefined function: stripos()
It seems that stripos() is a PHP5 only function, does this mean that my host is still using PHP4.5?
My code is
if (stripos ($suggestion, '://') !==false){
header( "Location: $errosuggesturl" );
exit ;
}
I believe that strstr is acceptable to PHP 4.5 and so I could define the function as follows:-
function stripos($haystack, $needle){
return strpos($haystack, stristr( $haystack, $needle ));
}
1. However, as a raw beginner I am not sure how I should define the function to match my bit of code. What would you suggest?
- Would I also have to surround my bit of code with <?php ... ?> as follows:-
<?php
if (stripos ($suggestion, '://') !==false){
header( "Location: $errosuggesturl" );
exit ;
}
?>
Regards
Awestruck