Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Trying to access array offset on value of type null on Instagramshoppable/Controller/Gallery/Popuphtml.php on line 58
$a1 = file_get_contents($insta_url); $b1 = json_decode($a1, TRUE);
$instaArr=$b1['graphql']['shortcode_media'];
This may occur if $b1 have some data but doesn't have index['graphql']['shortcode_media'];
So first check if the index exist then assign it to some variable your's code should be like
if(isset($b1['graphql']['shortcode_media'])) { $instaArr=$b1['graphql']['shortcode_media']; }
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.