what happens is that he wants to do an if that compares if the word COMPANIES is in a text but I don't know how to do the comparison in php, I know how to do it in javascript but I need to do it from php.
this was what i did
if ($info['programa_uvi'] !== 'EMPRESAS') {
echo "Si es diferente de EMPRESAS " . $tecnico;
}
The string that brings $info is "PROFESSIONAL IN BUSINESS ADMINISTRATION"
This part of your code:
It will not work for you to find the expected result, as it will evaluate the entire content of the key
programa_uvi
against the COMPANIES text .Depending on which version you are running from PHP 8, we have the function
str_constains
which helps us determine if a string contains a given substring .If this string exists, it returns
true
and otherwise it will returnfalse
.So the implementation can look like this: