Reply to problem with if (ereg)

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация