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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:34:32+00:00 2026-06-05T07:34:32+00:00

I have the following string and need to cut it into pieces. But how

  • 0

I have the following string and need to cut it into pieces. But how to do this correct?

The string: $sting = 0nl10000143947019,23000143947456,....,10450143947022

... means that more nrs can be in here

Now I want to cut down this string in the following parts:

$first contains the first nr or letter in the string. So in this case it should be: 0

$second contains the second and third nrs or letters in the string. So in this case it should be: nl

$third contains EVERYTHING after the third nr or letter in the string. So in this case it should be: 10000143947019,23000143947456,....,10450143947022

$fourth contains EVERYTHING after the last , in the string. Note the this nr can be bigger or smaller than in this excample. So in this case it should be: 10450143947022

Hope this is possible!

Kind regards

  • 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-05T07:34:33+00:00Added an answer on June 5, 2026 at 7:34 am

    Try the following:

    $first = substr($sting,0,1);
    $second = substr($sting,1,2);
    $third = substr($sting,3);
    $fourth = end(explode(',',$sting));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have the following string i need to split. $string = This is string sample
I have the following string: s=80 . I need to put this in an
I have following URL string /category/category1/2010/12/10/id I need to separate string into parts. I'm
I have the following string \u5733. I need to convert this to its respective
i have a string which has the following format (3,1,Mayer,Jack). I need all 4
I have the following string and need to extract the text inside the div's
I have the following String that I need to parse. I am looking for
I have the following string which i need to convert to integer or bigint.
I have the following basic classes (cut down for this question): public class Parent
I have the following string: 0000015700 I need an algorithm that does the following:

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.