This topic is locked
[SOLVED]

undefined function str_contains

5/7/2021 10:03:24 AM
PHPRunner General questions
P
Phil78 author

On an external menu I would like to call a different url depending on whether I am online.

to do, in ModifyMenuItem event i try to search one word which tell me if i am on local or not with test :
if (str_contains($url, 'kappatau'))
but i receive this error message for this function existing in PHP ?

Is there another way to know if I am online or offline ?

Admin 5/7/2021

Function str_contains() was only introduced in PHP 8. If your server runs a lower version of PHP this function will be undefined.

PHP manual

P
Phil78 author 5/10/2021

Sorry I hadn't noticed, I will use strstr() !

thank you !