I have string values related to images in a variable $photo covered by curly braces. I get this value from MySQL table. It has Image name, alt text, and image caption together in the string variable $photo. I want to extract image name, alt, and image caption covered by curly brackets.
I've added code that has the string value below,
<?php
$photo =' {"imagename":
{"filename":"imagename.jpg","alt":"Hunting Rifle","caption":"This is Hunter Image"}
}';
?>
I want to get filename and alt stings separately and store it in new variables separately[$filename,$alt] .
Anyone knows how to extract these particular strings from a string variable ?