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

  • Home
  • SEARCH
  • 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 711311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:43:15+00:00 2026-05-14T04:43:15+00:00

I wrote a PHP CUrl Class, if i execute Methods which should return the

  • 0

I wrote a PHP CUrl Class, if i execute Methods which should return the Content, it returns at first the Headers and after that the Content. So i cant parse any XML Data.
I need to Disable This Sample Output.

HTTP/1.1 200 OK
Date: Thu, 01 Apr 2010 20:11:58 GMT
Server: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny4 with Suhosin-Patch mod_ssl/2.2.9 OpenSSL/0.9.8g
X-Powered-By: PHP/5.2.6-1+lenny4
Set-Cookie: PHPSESSID=44beccf62f87546140d4a0bd24bd28b0; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Transfer-Encoding: chunked
Content-Type: application/xml

Here is The Curl Class

<?php

class Test_Curl
{
    protected $curl;
    protected $headers;
    protected $useragent;
    protected $url;
    protected $testkey;

    public function  __construct()
    {

    }

    public function setUseraget($useragent)
    {
        $this->useragent = $useragent;
        return $this;
    }

    public function setApiKey($key)
    {

        $this->billomatApiKey   = $key;
    }

    private function curlExecGeneral()
    {
        $result     = curl_exec($this->curl);
        curl_close($this->curl);
        return $result;
    }



    private function curlInitGeneral($request)
    {
        $this->curl = curl_init($request);
        curl_setopt($this->curl, CURLOPT_HEADER, true);
        curl_setopt($this->curl, CURLOPT_HTTPHEADER, array("X-testkey: ".$this->testkey, "Content-Type: application/xml"));
        curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);
    }

    public function get($request)
    {
        $this->curlInitGeneral($request);
        curl_setopt ($this->curl, CURLOPT_HTTPGET, true);
        return $this->curlExecGeneral();
    }

    public function post($request, $xml)
    {
        $this->curlInitGeneral($request);
        curl_setopt ($this->curl, CURLOPT_POST, true); //set the Requestmethod to POST
        curl_setopt ($this->curl, CURLOPT_POSTFIELDS, $xml); //add the xml data to the Request
        return $this->curlExecGeneral();
    }



}
?>
  • 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-14T04:43:16+00:00Added an answer on May 14, 2026 at 4:43 am

    See cURL options:

    curl_setopt($ch, CURLOPT_HEADER, 0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 541k
  • Answers 541k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You could use RegEx to make things a little cleaner:… May 17, 2026 at 2:50 am
  • Editorial Team
    Editorial Team added an answer Hopefully you can use this to output the HTML table… May 17, 2026 at 2:50 am
  • Editorial Team
    Editorial Team added an answer I just found this, I tried your exact idea and… May 17, 2026 at 2:50 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

i wrote a php script to generate random values between 1 and 99999999999999999999 (that's
I already wrote a PHP script that allows users to upload images but I
I wrote my own php captcha script, with a jpeg header, so that I
I'm trying to write a class that can add a bookmark to my Delicious
I'm hacking together a simple php script that will build a list of photo
I'm trying to write a simple PHP script which automatically sets up new etherpads
I wrote a php script. I want it show help message when called with
I have managed to get a UPS Shipping calculator working in PHP. I now
I'm trying to write a text parser with PHP, like Instapaper did. What I
I've made two versions of a script that submits a (https) web page form

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.