View Single Post
Old 2005-04-06, 09:40 PM   #1
Useless
Certified Nice Person
 
Useless's Avatar
 
Join Date: Oct 2003
Location: Dirty Undies, NY
Posts: 11,268
Send a message via ICQ to Useless
Terinary operator in PHP

Fuck me with a stick.

I have this piece of code which pulls words from flatfile databases:
Code:
$sentence = ($type ?
		"$word1[0] $word2[0] $word3[0] $word4[0]" :
		"$word1[0] $word2[0] $word3[0] $word4[0] $word5[0]");
In it's present form, I can only produce two different layouts for word strings, aka sentences. I'd like to be able to offer more layouts, but I can't figure out how to add another line without getting an error. Damn it. It's that fucking colon.
__________________
Click here to purchase a bridge I'm selling.
Useless is offline   Reply With Quote