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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:19:37+00:00 2026-06-16T04:19:37+00:00

I am working on a script that curls another site and then parses the

  • 0

I am working on a script that curls another site and then parses the results. I seem to be having some weird problems and I can’t understand where they are coming from; I have included the problematic part of my code as well as the output that is returned from it below:

<?php
    //my code to do some logic and build the curl

    $BookingConfirmation = curl_exec($ch);

    $testString = 'a test';
    var_dump($testString);
    echo '<br />';
    echo $BookingConfirmation;
    echo '<br />';
    var_dump($BookingConfirmation);
    echo '<br />';

    $bookingResults = explode('|', $BookingConfirmation);

    var_dump($bookingResults);
    die();
?>

when I then load the page, I am getting this output:

string(6) "a test"
booking|1||4000015|23628
string(2386) " booking|1||4000015|23628 "
array(6) { 
    [0]=> string(766) " string(1526) "108^1"> booking" 
    [2]=> string(1) "1" 
    [3]=>     string(0) "" 
    [4]=> string(7) "4000015" 
    [5]=> string(81) "23628 " 
} 

So according to what $BookingConfirmation is showing me, I wouldn’t expect the array to contain “108^1” anywhere within it. Also, why would the var_dump of $BookingConfirmation be showing that it is a 2386 character string? It is nowhere near that long. Another question is, what is happening with the second element that should be in the array? ($bookingResults[1]) The final dump of that array is showing that there are 6 elements, but with #1 being skipped there are only 5 being shown.

It also might be useful to note that none of these variable names are used anywhere else in the code.

Any thoughts would be greatly appreciated.

  • 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-06-16T04:19:38+00:00Added an answer on June 16, 2026 at 4:19 am

    Either use view-source, text/plain content-type, or run it through command line.

    <?php
        header("Content-Type: text/plain; charset=utf-8");
        //my code to do some logic and build the curl
    
        $BookingConfirmation = curl_exec($ch);
    
        $testString = 'a test';
        var_dump($testString);
        echo '<br />';
        echo $BookingConfirmation;
        echo '<br />';
        var_dump($BookingConfirmation);
        echo '<br />';
    
        $bookingResults = explode('|', $BookingConfirmation);
    
        var_dump($bookingResults);
        die();
    ?>
    

    I suspect the input contained <, which is rendered as some hidden html tag. I mean,string(2386) " booking|1||4000015|23628 ", means the string has 2386 bytes.

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

Sidebar

Related Questions

I'm working on a script that is supposed to install some software from a
Im working on a script that needs to find a match for certain letters(chords)
I'm working with a script that is calling the same class twice and throwing
I'm working on a script that will check if a user is an Administrator
I am working on a script that will scroll through list elements by clicking
I am working on php script that may involve a long running task. The
i'm working on a script that will monitor traffic on specific hosts from nagios.
I am working on a script that converts a .txt file (non delimited) to
I was working on a script that grabs the value from the selected option
I am working with a set of T4 script that generate partial classes for

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.