Http://try1115.infinityfreeapp.com/ - This site can't reached

Website URL

http://try1115.infinityfreeapp.com/

Error Message

This site can’t reached.

Hi JatinKumawat

This is what I see from the link:

Your website is accessible. It’s just that you need to fix the PHP code
Try the function array_key_exists() or isset().

Cheers!

2 Likes

I’d say isset() is the better option since it also works for array keys.

A shorthand that also works if you have a default value that you’d like to print is like this:

$var ?? "default";

This is just a shorthand for this:

if (isset($var)) {
    # either echo or return depending on context
    echo $var;
}
4 Likes

Hi wackyblackie,

The shorthand is only available since PHP 8, as I’m not sure if his/her server has been upgraded or not, the safest suggestion here is isset().

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.