Wrox Programmer Forums
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 16th, 2009, 03:50 PM
Authorized User
Join Date: Dec 2007
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
Old April 21st, 2009, 11:57 AM
Friend of Wrox
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts

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:
if( $_POST[‘Submit’] == “Search” ) 
   echo "for";
Charlie Harvey's website - linux, perl, java, anarchism and punk rock: http://charlieharvey.org.uk
The Following User Says Thank You to ciderpunx For This Useful Post:
sandeepgreaternoida (April 21st, 2009)

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

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.