-1

is there a function to convert any character to a integer, and then back? I tried using ord($string) and chr($int), however ord() sometimes returns an array for unusual letters from other languages, such as for "Ü" "Ä" and "Ö" from the german alphabet, is there any way to force it to return a single integer? Or is there an alternative?

Edit: Programming in PHP

La-comadreja
  • 5,627
  • 11
  • 36
  • 64
batscs
  • 1
  • 1

1 Answers1

-1

You can typecast the string to integer:

<?php

$num_string = "100";

$num = (int) $num_string;