how to build the function - PLEASE HELP ME

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
azri_bech
Forum Newbie
Posts: 14
Joined: Fri Aug 07, 2009 11:15 pm

how to build the function - PLEASE HELP ME

Post by azri_bech »

i'm new php programmer
Query result - the query result displayed the code for by_channel
for example: No. by_channel
---- -----------
1. S
2. E
3. W

how to build the function to make by_channel is display more meaningful like this:
No. by_channel
---- -----------
1. SMS
2. EMAIL
3. WEBSITE

please help to solve my problem,thank you
frao_0
Forum Commoner
Posts: 27
Joined: Sat Aug 08, 2009 3:52 am
Location: Toulouse, France

Re: how to build the function - PLEASE HELP ME

Post by frao_0 »

Personnally, i did not understand nothing at all
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: how to build the function - PLEASE HELP ME

Post by Mark Baker »

Code: Select all

 
function displayByChannel($byChannel) {
   switch ($byChannel) {
      case 'E' : $returnValue = 'EMAIL';
                 break;
      case 'S' : $returnValue = 'SMS';
                 break;
      case 'W' : $returnValue = 'WEBSITE';
                 break;
   }
   return $returnValue;
}
 
azri_bech
Forum Newbie
Posts: 14
Joined: Fri Aug 07, 2009 11:15 pm

Re: how to build the function - PLEASE HELP ME

Post by azri_bech »

Thank you so much :)
Post Reply