PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

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 Dev Shed Forums Sponsor:
  #1  
Old January 14th, 2003, 09:59 PM
Nasrim Nasrim is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2002
Posts: 809 Nasrim User rank is Corporal (100 - 500 Reputation Level)Nasrim User rank is Corporal (100 - 500 Reputation Level)Nasrim User rank is Corporal (100 - 500 Reputation Level)Nasrim User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 Days 14 h 59 m 53 sec
Reputation Power: 11
Question mark in code

OK semi silly question, in much of the php coding I see a line such as this:

PHP Code:
isset($HTTP_GET_VARS['t'])?$HTTP_GET_VARS['t']:''


I beleive it's a shortcut for an if/else statement, but I'd like to get a better understanding of it. If someone could break it down and explain it to me I'd appreciate it.

Reply With Quote
  #2  
Old January 14th, 2003, 10:05 PM
AlCapone's Avatar
AlCapone AlCapone is offline
Mobbing Gangster
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Sep 2001
Location: "Best City" 2002 and 2003- Melbourne, Australia
Posts: 4,913 AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level)AlCapone User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 h 36 m 31 sec
Reputation Power: 18
Send a message via ICQ to AlCapone Send a message via AIM to AlCapone Send a message via Yahoo to AlCapone
(is this true)?'yes! do me':'no, do this';

Of course, perl style $var=$one || $two is much easier, but they didn't want to implement it
__________________
And you know I mean that.

Reply With Quote
  #3  
Old January 14th, 2003, 10:59 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed God (5000 - 5499 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 5,028 Onslaught User rank is Brigadier General (60000 - 70000 Reputation Level)Onslaught User rank is Brigadier General (60000 - 70000 Reputation Level)Onslaught User rank is Brigadier General (60000 - 70000 Reputation Level)Onslaught User rank is Brigadier General (60000 - 70000 Reputation Level)Onslaught User rank is Brigadier General (60000 - 70000 Reputation Level)Onslaught User rank is Brigadier General (60000 - 70000 Reputation Level)Onslaught User rank is Brigadier General (60000 - 70000 Reputation Level)Onslaught User rank is Brigadier General (60000 - 70000 Reputation Level)Onslaught User rank is Brigadier General (60000 - 70000 Reputation Level)Onslaught User rank is Brigadier General (60000 - 70000 Reputation Level)Onslaught User rank is Brigadier General (60000 - 70000 Reputation Level)Onslaught User rank is Brigadier General (60000 - 70000 Reputation Level)Onslaught User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Days 3 h 46 m 43 sec
Reputation Power: 641
Yeah, the above syntax is following the C syntax. It looks cryptic at first, but it is pretty simple and to the point.

Reply With Quote
  #4  
Old January 14th, 2003, 11:02 PM
Nasrim Nasrim is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2002
Posts: 809 Nasrim User rank is Corporal (100 - 500 Reputation Level)Nasrim User rank is Corporal (100 - 500 Reputation Level)Nasrim User rank is Corporal (100 - 500 Reputation Level)Nasrim User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 Days 14 h 59 m 53 sec
Reputation Power: 11
Thx, I knew it was something like that, just wasn't sure about it.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Question mark in code


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



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT