Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3210812
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T14:37:27+00:00 2026-05-17T14:37:27+00:00

Is it possible to do a cURL post with PHP that will post my

  • 0

Is it possible to do a cURL post with PHP that will post my array of values and return only the curl_getinfo data but none of the page content? Here is an example of what I am currently using; it returns the page content into a variable.

However, every time it returns the page content it uses a lot of bandwidth. I’m trying to reduce the amount of bandwidth I use; all I really need back is the curl_getinfo data.

Would adding CURL_TIMECOND_IFMODSINCE accomplish this? (the page I’m posting to very rarely changes)

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POST, true);

$post_data = array();
$post_data["name"] = $name;
$post_data["age"] = $age;

curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
$output = curl_exec($ch);
$info = curl_getinfo($ch);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T14:37:27+00:00Added an answer on May 17, 2026 at 2:37 pm

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);


    is used to return output

    $output = curl_exec($ch);


    set CURLOPT_RETURNTRANSFER to false so that it will not.

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Post data and retrieve the response using PHP Curl? I want to
Is it possible to monitor a page's AJAX calls via cURL in PHP? For
I have noticed that cURL in PHP returns different data when told to output
Is it possible to send a multi-associative array to a page using cURL in
I have a PHP script that syncs data with a third party service, and
I have a set of php processing pages that interact together by passing data
The Post looks like this. $data = array('icd9' => $icd9, 'cpt' => $cpt, 'session_id'=>
Possible Duplicate: Implement page curl on android? How to do page flipping/turning or curl
Possible Duplicate: CURL alternative in Python I'm trying to write a python snippet that
So the gist is that I need to post XML data query to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.