The following will echo "12334".
However, I would like for the "12334" to be placed in a variable say $wordNumValue. I know it might be a simple thing, but to me it is not. Any help is much appreciated.
<?php
$msg ="hello";
$arrEn = str_split($msg);
foreach ($arrEn as &$value) {
if ($value == 'h') {
echo "1";
} elseif ($value == 'e') {
echo "2";
} elseif ($value == 'l') {
echo "3";
} elseif ($value == 'o') {
echo "4";
} else {
echo 'NULL';
}
}
?>