View Single Post
Old 10-11-2007, 06:47 AM   #1 (permalink)
Love.Oasis
banned
 
Join Date: Oct 2007
Posts: 21
Love.Oasis is on a distinguished road
Store String as Hex

Hello,

I currently have two arrays:
  1. Holding numbers 1-5
  2. Holding hex values for the 5 numbers
How do I the string for occurrences of the numbers found inside the 1st array, and upon one being found, how do I store the hex values inside the $result variable?

Code:
$string = "32451";
$numbers = array('1','2','3','4','5'); // array1 - stores numbers 1-5
$hex = array('41','42','43','44','45'); // array2 - stores numbers hex values

echo $result;
Example: Using the code above as an example, the result variable should eventually hold the following: "4342444541"
Love.Oasis is offline   Reply With Quote