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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:37:28+00:00 2026-05-21T17:37:28+00:00

Good day to all. I am using zend+smarty, but I don’t think the framework

  • 0

Good day to all. I am using zend+smarty, but I don’t think the framework has any thing to do with the problem. I have the following scenario:

     A script that gets a string from a specified site using an api. The string is retrieved corectly so I'll just assign a string to a variable:

     $string = 'String retrieved from api.';
     $string = strstr($string, "<?xml", false);

     libxml_use_internal_errors(true);
     $xml = simplexml_load_string($body);

Sounds ok, looks ok. Now the problem.

When I use that on our local test machine it works like a dream. No problem at all. On the other hand, on the production machine I get this:

Warning: Wrong parameter count for strstr() in /home/prj/include/DatabaseObject/Ctrl.php on line 720 (this is the strstr line).

I checked the strings before strstr on the 2 machines and they are identical. Also on the second server after the strstr line the string becomes empty (on the other one it is correctly transformed).

I really don’t get it… the code is the same. The string is the same. Is a bit strange to me.

  • 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-21T17:37:29+00:00Added an answer on May 21, 2026 at 5:37 pm

    The third paramater “before needle” – a boolean value – was added in php 5.3. It’s likely your production server is running an earlier version.

    see PHP.net

    strstr ( string $haystack , mixed $needle [, bool $before_needle = false ] )

    • 5.3.0 Added the optional parameter before_needle.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good day to all, I have the following problem I have to convert the
Good day everyone. I have been having the same problem all day at work
Good day all; I am trying to manually (not using sublayers) draw images within
So I've spent all day looking for good examples of using xpath / xquery
Good Day All, I’m new to programming. I’m using Visual Studio 2010. I’m taking
Good Day All, I’m new to programming. I’m using Visual Studio 2010. I’m taking
Good day to all. I have a question, i'm using wpf and i cant
I have been looking for a good solution all day, but Google evolves so
Good day All, A mix-up at the printers (or on our end) has resulted
Good day! I tried using JSTL in java but there's an error: exception javax.servlet.ServletException:

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.