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

The Archive Base Latest Questions

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

Here is an example of how I am using strstr on my localhost on

  • 0

Here is an example of how I am using strstr on my localhost on PHP 5.3.10

<?php
$string  = '25_testing';
$test = strstr($string, '_', true); // As of PHP 5.3.0
echo $test; // prints 25
?>

Well, I uploaded my files on my hosting server but they are running off of PHP 5.2 so the function strstr($string, '_', true) does not work. Is there an alternative I can use, to get the same results?

  • 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-30T14:27:16+00:00Added an answer on May 30, 2026 at 2:27 pm

    Try this…

    First you return the string after “_” (including itself) and then replace it with nothing. Not very nice but it works 😉

    <?php
        $string = "25_testing";
        echo str_replace(stristr($string,"_"),"",$string);
    ?>
    

    or

    <?php
        $string = "25_testing";
        echo str_replace(strstr($string,"_"),"",$string);
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for something like break for loops. Here's some example code (using Symfony's
Here is an (artificial) example of using a function that returns an anonymous struct
I'm so close! I'm using the XNA Game State Management example found here and
Here is a complete example. I want to forbid using A::set from objects casted
Just using this as an example... Here are the columns in my UserProfile table:
I'm using the example here . If there isn't a value for the key,
Here's an example: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SharpLibrary_MediaManager {
Here's an example using multiple interface inheritance in Java and there's an issue. Note
Here's a simplified version of my example: using (DbCommand cmd = new SqlCommand(myProcedure, (SqlConnection)DataAccessHelper.CreateDatabase().CreateConnection())
I am trying to print an ASP.NET Image using the example here . When

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.