Posted by fender_gr on 10/07/05 13:49
Dear All,
How can i convert the following numbers (row1) to text (row2)
0030697 --> general
0030697111xxxx --> low
0030697211xxxx --> medium
0030697011xxxx --> high
I have tried the following but always matches the numbers accodring to
the first if case :
if (ereg("0030697", $myquery_called_number)) {
$myquery_called_number='GENERAL'; } else { $myquery_called_number =
"$myquery_called_
number";}
if (ereg("0030697111xxxx", $myquery_called_number)) {
$myquery_called_number='LOW'; } else { $myquery_called_number =
"$myquery
_called_number";}
if (ereg("0030697211xxxx", $myquery_called_number)) {
$myquery_called_number='MEDIUM'; } else { $myquery_called_number =
"$myquery
_called_number";}
if (ereg("0030697011xxxx", $myquery_called_number)) {
$myquery_called_number='HIGH'; } else { $myquery_called_number =
"$myquery
_called_number";}
the output for this is :
GENERAL
GENERAL
GENERAL
GENERAL
but i was expected to see
GENERAL
LOW
MEDIUM
HIGH
any ideas ?
Thanx
[Back to original message]
|