I have a basic curl code to fetch json data

I have a basic curl code to fetch json data

The code is working fine on my localhost server but when i upload it to cpanel/server it gives blank response

We need to resolve this using curl only

No javascript or filegetcontent

this are the codes once i award you i will give ftp access also so you can fix it


echo "string";

function fetchData($url){

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

curl_setopt($ch, CURLOPT_HTTPHEADER, array(

'Content-Type: application/json',

'Connection: Keep-Alive'


curl_setopt($ch, CURLOPT_HTTPHEADER,array("Expect: "));

curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');

curl_setopt($ch, CURLOPT_TIMEOUT, 20);

curl_setopt($ch, CURLOPT_VERBOSE, true);

$result = curl_exec($ch); // run the whole process

return $result;


// Define Variables here

$username = 'tosslounge';

$url = [];

$videoType = [];

// Function Calling

$result = fetchData("[login to view URL]");

// Decode JSON into Array

//$result = json_decode($result);

// Get Post From Result and Assign it to Posts array

$posts = $result->graphql->user->edge_owner_to_timeline_media->edges;



// Push Url and Name of Posts into Arrays

for($i = 0; $i < count($posts); $i++){

array_push($url, $posts[$i]->node->display_url);

array_push($videoType, $posts[$i]->node->__typename);



Compétences : PHP, JavaScript, MySQL, Architecture Logicielle, Java

en voir plus : visual basic code extract excel data, fetch currency data website, source code export sql data csv file vb6, how to get curl post data in php, php get json data from api, php curl json response to array, how to get json response using curl in php, php curl get request body, how to fetch data using curl in php, how to get json response from rest api in php, how to fetch data from api in php, sample code generate fake data, using perl fetch mssql data, php code mysql export data microsoft word, visual basic code extract web data, code fetch yahoo realtime data, code fetch mysql data xml, perl code fetch data file, fetch json data url java console, use d3 json to fetch the metadata for a sample

Concernant l'employeur :
( 16 commentaires ) Salmiya, Kuwait

Nº du projet : #27275157

Décerné à:


Salam Alekum Thank you for posting this my dear! Can I see this on your localhost? and on your host? I can fix it for you for sure. regards Bryar

%selectedBids___i_sum_sub_4% %project_currencyDetails_sign_sub_5% USD en 1 jour
(17 Commentaires)

5 freelancers are bidding on average $20 for this job

(71 Commentaires)
(26 Commentaires)

Greetings! My name is Kamlesh Kumar and I am a full-stack web developer. I believe my skills match for your project. I have a good grasp of working with PHP. I see your job description. I am ready for start working rig Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(26 Commentaires)

Hi there, I'm professional developer and interested in this job, If you want me to work with you please feel free to contact me anytime. Thanks

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(2 Commentaires)