hi, how the heck do i convert a string into its equivalent ascII num - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

hi, how the heck do i convert a string into its equivalent ascII num

cmario00cmario00 Posts: 12Member
I need to convert a characters into ascII numbers in order to do some simple caesar shifting (just for testing purposes obviously). Can someone tell me how to do this? Thank you.

Mario Aguilera
[email protected]


  • SouldrinkerSouldrinker Posts: 143Member
    First of all: stay cool! :-)

    And now, here is the function to return the ascII Value of some char:

    int ord ( char char )

    you could use the function something like this:

    $my_val = ord ( " " );

    "$my_val" would now contain the value "32".

    have a nice day!

    best regards,

    sebastian mohrenstecher
    executive secretary

    [email protected]

  • cmario00cmario00 Posts: 12Member
    i knew there had to be a function for that, couldn't find it anywhere though. Thanks
Sign In or Register to comment.