0

My PHP code: https://codeshare.io/0gjlqN

print_r($res['items'] ?: ''); Returning Data like: https://codeshare.io/j06b4g

But the errors are :

Notice:  Undefined index: items in C:\xampp\htdocs\getsites\index.php on line 28



Notice:  Undefined index: items in C:\xampp\htdocs\getsites\index.php on line 30



Warning:  count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\getsites\index.php on line 34

        

Notice:  Undefined index: items in C:\xampp\htdocs\getsites\index.php on line 28



Notice:  Undefined index: items in C:\xampp\htdocs\getsites\index.php on line 30



Warning:  count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\getsites\index.php on line 34
  • 1
    Your code must be here, not somewhere else. See [ask] and how to make a [mre] – ADyson Dec 04 '21 at 15:52
  • 1
    Those are not errors, those are notices. Just as the messages state. This just means that the array you access does not hold an element with the key "items". You need to check that before accessing it. – arkascha Dec 04 '21 at 16:56

0 Answers0