PHP Exercises

6. Write a program to convert the given string into an array. Suppose the string is -
$a = 'Burch Jr, Philip H., The American establishment, Research in political economy 6(1983), 83-156';




7. Write a php program to loop over the json data. Suppose, you have the following json data.

[
	{
	"name" : "John Garg",
	"age"  : "15",
	"school" : "Ahlcon Public school"
	},
	{
	"name" : "Smith Soy",
	"age"  : "16",
	"school" : "St. Marie school"
	},
	{
	"name" : "Charle Rena",
	"age"  : "16",
	"school" : "St. Columba school"
	}
]
9. Write a program to loop through an associative array using foreach. Suppose an associative array is -
$a = array('one' => 'I', 'two' => 'II', 'three' =>'III', 'four' => 'IV');
















Read more articles


General Knowledge



Learn Popular Language