PHP Installation
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Click Here
Go Back   Codewalkers ForumsPHP RelatedPHP Installation

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old October 28th, 2005, 06:20 AM
ncamy32 ncamy32 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: asheville
Posts: 1 ncamy32 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Help adding Couple in Gender

yes i am veary new to this and i was wanting to add couples to the gender and this is what i am working with any help would be nice

php Code:
Original - php Code
  1. <? if($gender=="M") print "Male"; else print "Female";?>

Reply With Quote
  #2  
Old October 28th, 2005, 10:53 AM
honcho's Avatar
honcho honcho is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Cape Cod
Posts: 1,347 honcho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 2 sec
Reputation Power: 3
RE: Help adding Couple in Gender

Here are two ways to do this:
php Code:
Original - php Code
  1.  
  2. if($gender=="M") print "Male";
  3. elseif($gender=="F") print "Female";
  4. else print "Couple";

or with a switch statement:
php Code:
Original - php Code
  1.  
  2. switch($gender)
  3. {
  4.   case "M": print "Male"; break;
  5.   case "F": print "Female"; break;
  6.   default: print "Couple";
  7. }

There are other, more cryptic ways too:
php Code:
Original - php Code
  1.  
  2. print ($gender=="M" ? "Male" : ($gender=="F" ? "Female" : "Couple"));

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Installation > Help adding Couple in Gender


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

IBM developerWorks




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway