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 6206641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:29:07+00:00 2026-05-24T05:29:07+00:00

I have been messing with CURL for the past day and I cannot seem

  • 0

I have been messing with CURL for the past day and I cannot seem to figure out how to parse out the return data. I know I could write a REGEX to extract data from the response but it seems like there is some function I am probably missing. Here is what I would like to try and do.

I want to make POST to a different domain and get back 3 things
1. the response headers
2. the response data
3. a session cookie

Is there a way I can get those 3 things back separately? right now I just get back a plain text response with the response header and the response data. I would like to be able to do something like

$Response = curl_exec($Curl_Connection);
$ResponseData = $Response['Data'];
$ResponseHeader = $Response['Header'];
ResponseCookie = $Response['Cookie'];

Does curl provide anything like this?

  • 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-24T05:29:08+00:00Added an answer on May 24, 2026 at 5:29 am

    As I answered:

    no post data returned when requesting headers CURLOPT_HEADER. PHP CURL

    Add:

    curl_setopt($Curl_Connection, CURLOPT_HEADER, TRUE);
    
    $Response = curl_exec($Curl_Connection);
    $curlHeaderSize=curl_getinfo($ch,CURLINFO_HEADER_SIZE);
    
    $ResponseData = mb_substr($result, $curlHeaderSize);
    $ResponseHeader = mb_substr($result, 0, $curlHeaderSize);
    
    preg_match_all('|Set-Cookie: (.*);|U', $ResponseHeader, $content);   
    $ResponseCookie = implode(';', $content[1]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background info: Over the past week, I have been messing around with Chrome extensions
I have been messing around with writing some stored procedures in .NET code with
I have been messing around with Leaks trying to find which function is not
I have a tricky problem that I've been messing about with for a few
I've just been messing around with file_get_contents() at school and have noticed, it allows
i have been messing around with a search engine and i am trying to
I have been messing with xslt off and on since I became a sharepoint
I have been messing with this for quite some time now and it's getting
I have been messing about with google calendars and I think they have a
OK I have been messing about with URL rewriting for the last few days

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.