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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:05:38+00:00 2026-05-23T03:05:38+00:00

I ask for a user to input 4 numbers or letter from 1 –

  • 0

I ask for a user to input 4 numbers or letter from 1 – 9 and a-f.

i then take these numbers and letters and str_replace them with 4 byte values.

So if the user inputs 00FF, the value would be 0000 0000 1111 1111, as 0000 is the 4 byte value of 0 and 1111 is the 4 byte value of F.

I want to get rid of any leading '0's from the total collection of 4 byte values.

I have tried using the below code to get rid of the 0’s from the start of it.

$hexvalue2 = ltrim($hexvalue,'0');
echo $hexvalue2;

However, this is not working, when looking at PHP.net as far as my knowledge goes this seems correct, but obviously its not.

Can anyone tell me where i am going wrong please? or perhaps suggest an alternative?

Thank you

  • 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-23T03:05:39+00:00Added an answer on May 23, 2026 at 3:05 am

    This works:

    <?
    $h = 0x00001111;
    
    $h = ltrim(dechex($h),"0");
    
    echo $h;
    ?>
    

    Output: 1111

    Note the dechex to get a string.

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

Sidebar

Related Questions

I need to ask a number from the user and have then if it
I am trying to take numbers from three EditText boxes that the user fills
want to ask user to input something but not want to wait forever. There
I want to ask the user for input in console. He'll be writing down
I'm trying to write a program that reads 2 numbers from the user and
This is a school project: Objective: Ask the user to input 2 number A
Continuously ask the user to enter numbers until the user enters a number that
I have a requirement where I ask user for confirmation and also display messages.
Suppose I ask the user do you want to run in 32bit mode or
Is it possible somehow to ask the user to allow cross-domain access instead of

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.