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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:28:44+00:00 2026-06-02T07:28:44+00:00

I have a question. To make things more clear, I will give an example:

  • 0

I have a question. To make things more clear, I will give an example:

Values are submited in a form. I have:

Value1: Blanc
Value2: Titanium
Value3: 100
Value4: 150
Value5: China

I want to get a value 6 that has this structure:

BLTIT-100150-CH

Value6 has: (2 chars from value1) + (3 chars from value5) +(-)+(value3+value4 +(-)+(2 chars of value5).
Is there way to make that with PHP Or JavaScript?

  • 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-02T07:28:47+00:00Added an answer on June 2, 2026 at 7:28 am

    In PHP:

    $Value6 = strtoupper(substr($Value1,0,2) . substr($Value2,0,3) . '-' . 
                         $Value3 . $Value4 . '-' . substr($Value5,0,2)
                        );
    

    Of course, this assumes your variables are set locally. If you’re getting them straight from the POST, you need $_POST['Value1'] instead of $Value1, etc.

    Look up substr – it takes a subsection of a string (known as a substring), given a starting point and a length.:
    http://php.net/manual/en/function.substr.php

    The . is the PHP string concatenation operator – it joins two strings together.

    strtoupper converts a string to uppercase (see http://php.net/manual/en/function.strtoupper.php)

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

Sidebar

Related Questions

I have to edit my question just to make it clear. What I need
I edited the question so it would make more sense. I have a function
NOTE: I've re written the original question to make it much more clear. I
Simplified the question to give a more clear representation of what I'm actually asking
I have a question about how to make marquee text smooth (using Qt 4.5.3)
I have a question, is this the correct approach to make a Generic Singleton?
I have a question about scheduling. I need to make a timetable generator for
Hello everyone I have a question... I'm trying to make my sms faker app,
i'm trying to make a site map and i have a question: my htaccess
This code works perfectly. I only have one question, I want to make it

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.