CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Code to return Alpha Value of a Number

Print topic Send  topic

Author Message
ckroon

Posts: 869
Posted: 10/25/2010, 3:27 PM

I need some code that will take a number: ex: '12345'

and return the Text Values of each number:

Result = "ABCDE"

Any takers?
:-D
_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
saseow

Posts: 744
Posted: 10/25/2010, 10:45 PM

Have a look at the ascii table here: http://www.asciitable.com/

You can possible have 10 numbers i.e. 0-9 so which will correspond to A to J if you add 64 to each of the numbers in your number variable.

Then use php's chr function found here: http://php.net/manual/en/function.chr.php

That should do it.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.