Hello friends I have a problem is that I have a code that works under a functionality of php 8.0 and I need to upload this functionality to php 7.2 and I can not update the server, is there any way to modify the function for another so that it does the same this function is will call str_contains.
if (!str_contains($info['programa_uvi'], 'EMPRESAS') || str_contains($info['programa_uvi'], 'TECNICO PROFESIONAL')) {
if (str_contains($info['programa_uvi'], 'TECNICO')) {
echo "Por lo tanto, una vez realizado el análisis de homologación, y de ser aceptado el presente, deberá cursar y aprobar " . $tecnico . " espacios académicos equivalentes " . $cre_tecnico . " créditos del plan de estudios de la Uvirtual, para así nivelar y finalmente optar por el título " . $info['programa_uvi'] . ". Dichos espacios académicos si se toma en cada periodo 9 creditos se podrian demorar aproximadamente ";
if (round(($cre_tecnico / 9), 0, PHP_ROUND_HALF_UP) < 0.5) {
echo "1 periodo trimestral.";
} else {
echo round(($cre_tecnico / 9), 0, PHP_ROUND_HALF_UP) . " periodos trimestrales.<br><br>";
}
echo "Espacios academicos pendientes por cursar y aprobar de acuerdo al nivel de formacion para obtener el titulo: Tecnico ".$tecnico.", Tecnologico ".$tecnologo-$tecnico.", Universitario ".$profesional-$tecnologo.".";
}
If the function does not exist , you can create it trying to simulate the behavior of the original :
Grades:
change str_contains to strpos to achieve ´backward compatibility´:
strpos
return the position of the first occurrence of the searched text within the string, in case it does not appear it returnsfalse
.