Question:
php determines whether a variable contains (includes) a specific string
If there is a variable
$liehuo_net="123456789.exe"
How to make the program make the following judgment:
If there is "exe" in $liehuo_net, then output "EXE"
If there is no "exe", determine whether there is "123"
If there is "123", output "one two three"
If not, output "none"
Answer:
$liehuo_net="123456789.exe";
if(strstr($liehuo_net,"exe"))
{
echo "exen ";
}
elseif(strstr($a,"123"))
{
echo "one two three n";
}
else
{
echo "Nothing";
}
?>