Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0
This is the forum to discuss the Wrox book Beginning PHP5, Apache, and MySQL Web Development by Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz, Michael K. Glass; ISBN: 9780764579660
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 16th, 2009, 03:50 PM
Authorized User
 
Join Date: Dec 2007
Location: greaternoida, u.p, India.
Posts: 65
Thanks: 9
Thanked 2 Times in 2 Posts
Send a message via AIM to sandeepgreaternoida Send a message via MSN to sandeepgreaternoida Send a message via Yahoo to sandeepgreaternoida
Arrow Ternary Operator

[
<?php echo $_POST[‘Submit’] == “Search” ? “for “ : “”; ?>
/]


Pls. help me in chaging the above ternary operator statement in IF AND ELSE statement.
God bless you !
__________________
sandeep gupta
Reply With Quote
  #2 (permalink)  
Old April 21st, 2009, 11:57 AM
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Code:
<?php
if( $_POST[‘Submit’] == “Search” ) {
   echo "for";
}
else {
   echo "";
}
?>
But echo-ing nothing is sort of useless ;-) And we can do without the squiggly brackets for a single statement (the echo). So you could simplify it further like this:
Code:
if( $_POST[‘Submit’] == “Search” ) 
   echo "for";
__________________
--
Charlie Harvey's website - linux, perl, java, anarchism and punk rock: http://charlieharvey.org.uk
Reply With Quote
The Following User Says Thank You to ciderpunx For This Useful Post:
sandeepgreaternoida (April 21st, 2009)
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to use like operator thillaiarasu SQL Server 2000 4 April 23rd, 2010 09:47 AM
=== operator in c# surendraparashar C# 2005 8 November 8th, 2007 05:14 AM
Invalid operator for data type. Operator equals di Pusstiu SQL Server 2000 2 August 10th, 2007 04:51 AM
conditional (ternary) operator using C# cjo ASP.NET 1.0 and 1.1 Basics 3 January 12th, 2005 11:55 AM



All times are GMT -4. The time now is 05:49 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.