I made this code
$message = 'This domain has strpos';
$links = array('domain.com', 'do.main');
$safe = strpos($message, $links);
return $message;
but got error errorHandler->error in my page, whats wrong with my code? did I do some missing code?
what I want just detect if the message have string in $links then do rest of my code
thanks for droping out
Please try this one will give expected output.
$message = 'This domain has strpos';
$links = array('domain.com', 'do.main');
$safe = array();
foreach($links as $key=>$result){
if(strpos($message, $result) != false){
$safe[$result] = "String is available";
} else{
$safe[$result] = "String is not available";
}
}
print_r($safe);