index.php

<?php
$url = "http://itools.codexpedia.com/demo/php-curl-example/getEmployees.php";
//  Initiate curl
$ch = curl_init();
// Disable SSL verification
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// Will return the response, if false it print the response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Set the url
curl_setopt($ch, CURLOPT_URL,$url);
// Execute
$results=curl_exec($ch);
$results=json_decode($results, true);

var_dump($results);

getEmployees.php

<?php
	header("Content-type: application/json");
    $employees = 
    array(
			array
			(
			"name" => "Jack",
			"title" => "Magager",
			"salary" => "$60,000",
			),

			array
			(
			"name" => "Joe",
			"title" => "Developer",
			"salary" => "$50,000",
			),

			array
			(
			"name" => "Susan",
			"title" => "Marketer",
			"salary" => "$50,000",
			)
		);

    echo json_encode($employees);

html output

array(3) { [0]=> array(3) { ["name"]=> string(4) "Jack" ["title"]=> string(7) "Magager" ["salary"]=> string(7) "$60,000" } [1]=> array(3) { ["name"]=> string(3) "Joe" ["title"]=> string(9) "Developer" ["salary"]=> string(7) "$50,000" } [2]=> array(3) { ["name"]=> string(5) "Susan" ["title"]=> string(8) "Marketer" ["salary"]=> string(7) "$50,000" } }