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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:07:01+00:00 2026-05-22T18:07:01+00:00

I have a product that is sold to multiple customers, each customer has its

  • 0

I have a product that is sold to multiple customers, each customer has its own unique product code derived from the my original product code e.g

My code: 1245-65

Customer 1: 1245/65

Customer 2: 1245.65

My question: Is there any way to analyse such a string and find what is separating its integers? My goal is to have a settings page where a demo customer code would be entered then all product codes would be derived from that example code. I’m sure PHP can handle this!

EXTRA INFO:

Sorry, I haven’t given enough information. There might be a situation where the separator is an alphabetical quantity e.g 1245ABC65. I hate updating a question like this when so many people have given valid answers 🙁 my fault.

  • 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-22T18:07:01+00:00Added an answer on May 22, 2026 at 6:07 pm

    You may want to look for non numeric characters using preg_match_all

    preg_match_all('/[^0-9]/', '1245-95', $matches);
    print_r($matches);
    
    //Array ( [0] => Array ( [0] => - ) ) in the example
    

    With the updated question, you have to write :

    $str = '1245ABC65';
    preg_match("/\d+([^0-9]+)\d+/", $str, $separator);
    echo $separator = $separator[1];
    

    or

    preg_match_all('/[^0-9]+/', '1245ABC95', $matches);
    print_r($matches);
    
    //Array ( [0] => Array ( [0] => 'ABC' ) ) in the example
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table hall_products with products. Each product has a NAME, is sold
We have a product that uses a Reference from a 3rd party supplier. With
I have a product that I distribute to my clients. Each client needs some
My problem is that I have three different stock sizes for each product that
I have my database set up as such: Each product I have has it's
I have some product that has custom prices. Depending on the option selected, there
I have a product that's packaged as an MSI. When my customers install a
I have some legacy product data that has proven difficult to work with. The
I have data that looks like this. SoldToRetailer OrderDate | Customer | Product |
We have a product that runs Sql Server Express 2005 and uses mainly ASP.NET.

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.