home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

Php IF statement

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1361
Discussions: 200,930, Posts: 2,379,151, Members: 246,296
Old June 14th, 2006, 03:17 PM   Digg it!   #1 (permalink)
SoMuchAnime-SoLittleTime
 
EXreaction's Avatar
 
Join Date: Aug 2003
Location: Plymouth, WI
Posts: 14,983
Blog Entries: 1
Send a message via MSN to EXreaction
Php IF statement

Hey guys, I have a quick question about the if statements...how do I make a single line one in php?

I have:
Code:
if ($board_config['reg_web_disable'] == '1')
{
	$template->assign_block_vars('switch_edit_website', array());
}
How would I make that 1 line to save on space?
__________________
My photography: Flickr

Lithium Studios - phpBB3, PHP, and Web Development
EXreaction is offline   Reply With Quote
Old June 14th, 2006, 04:05 PM     #2 (permalink)
Banned
 
Iturea's Avatar
 
Join Date: Jan 2004
Location: Earth
Posts: 420
Code:
if ($board_config['reg_web_disable'] == '1'){$template->assign_block_vars('switch_edit_website', array());}
Quote:
Originally Posted by EXreaction
Hey guys, I have a quick question about the if statements...how do I make a single line one in php?

I have:
Code:
if ($board_config['reg_web_disable'] == '1')
{
	$template->assign_block_vars('switch_edit_website', array());
}
How would I make that 1 line to save on space?

Iturea is offline   Reply With Quote
Old June 14th, 2006, 04:18 PM     #3 (permalink)
SoMuchAnime-SoLittleTime
 
EXreaction's Avatar
 
Join Date: Aug 2003
Location: Plymouth, WI
Posts: 14,983
Blog Entries: 1
Send a message via MSN to EXreaction
Ya, I could do it that way, but isnt there a way that uses : and ? in an if statement and has it all on one line?
EXreaction is offline   Reply With Quote
Old June 14th, 2006, 04:34 PM     #4 (permalink)
Banned
 
Iturea's Avatar
 
Join Date: Jan 2004
Location: Earth
Posts: 420
Quote:
Originally Posted by EXreaction
Ya, I could do it that way, but isnt there a way that uses : and ? in an if statement and has it all on one line?

Considering there is no else statement you will not find the : Ternary Operator.

PHP Code:
$template->($board_config['reg_web_disable'] == '1') ? assign_block_vars('switch_edit_website', array()); 
Iturea is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
IF Statement Help Needed NeoStarO1 Applications and Operating Systems 2 July 29th, 2004 01:18 AM
change statement jilshi Webmastering and Programming 2 May 4th, 2004 10:17 AM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (2869)
Obama the Muslim (14)
California Passes Anti-Flat-HDTV Le.. (39)
Is the PSU I received dead? (10)
windows vista security holes (9)
HIS HD5770 graphic card question (15)
Print spooler problem (13)
Foreign voltage (10)
Install XP pro and a Vista laptop ?.. (10)
Dept. of HS: NSA 'Helped' Develop V.. (15)
A good PSU? (10)
Ideal cheap graph card for PC-Gamin.. (16)
New Computer wont recognize XP disc (7)
EVGA 9800 gtx help with finding a g.. (8)
Recent Discussions
solutions for virtical white lines on.. (1)
favorit (0)
Regular Build (3)
Ideal cheap graph card for PC-Gaming? (16)
Graphics Card Upgrade Question (0)
Fire in DVD (2)
Modern Warfare For the PC (33)
radeon x850xt platinum & shader 3 (3)
Have you switched yet? (84)
Install XP pro and a Vista laptop ?? (10)
Wireless Router+Cable Modems and Much.. (0)
Optical Audio A-B Switch (1)
windows vista security holes (9)
The NTDVM CPU has encountered an ille.. (24)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (34)
Wireless speakers for PC? (11)
Print spooler problem (13)
Help getting around port 80 for camer.. (2)
Display shows 3x5 inch in middle of s.. (3)
monitor will not turn on at all, (1)
World's largest Monopoly Game using G.. (331)
Foreign voltage (10)
FiOS modem/router interfering with ne.. (7)
Browsers wont load websites (2)
Virus Doctor Popup? (1)


All times are GMT -4. The time now is 05:56 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28