My code works on localhost via APACHE, but when I hosted a website with all the same files and code i get this message:
Fatal error: Call to undefined function str_contains() in /storage/ssd3/524/16325524/public_html/static/header.php on line 55
PHP Code where error shows:
<?php
$menu = getAllData('meni');
global $korisnik;
for ($i = 0; $i < count($menu); $i++){
if(isset($_SESSION['korisnik'])){
if(str_contains($menu[$i]->naziv, 'login') || str_contains($menu[$i]->naziv, 'reg')){
continue;
}
echo '<li><a href='.$menu[$i]->putanja.'>'.$menu[$i]->naziv.'</a></li>';
}
else {
if (str_contains($menu[$i]->naziv, 'profile') || str_contains($menu[$i]->naziv, 'out')) {
continue;
}
echo '<li><a href=' . $menu[$i]->putanja . '>' . $menu[$i]->naziv . '</a></li>';
}
}
?>