Skip to content

Stuart Benjamin Ford

I speak my mind involuntarily. It's both a blessing and a curse

Uncategorized

Ternary PHP short-hand if/else statement

Posted on Wednesday 20th April 2011 by Stuart Ford

Saves using a cumbersome multi-line control structure for simple conditions like this:

Development Notebook PHP

Recent News

  • It will take a global pandemic to force us to finally embrace home working
  • It’s time to have a grown-up conversation about Thomas Cook
  • Boycott the 2022 FIFA World Cup
  • Seven years in Birmingham
  • EBS and RDS snapshot management script for Amazon AWS
  • #OrlandoStrong #OrlandoUnited
  • Why I’m bowling for #brexit
  • General election manifestos – A landlord’s guide
  • Third Mac mini
  • Home energy monitor reveals consumption horrors
  • Where is my iPhone Mini?
  • A very Angular learning curve
  • MRTG Dashboard
  • Driven to drop Google Drive for Dropbox
  • Airplay with Raspberry Pi
  • Mac, Apache, MySQL and PHP (MAMP)
  • Call centre HUD for Asterisk
  • London 2012 Olympic Games
  • Diamond Jubilee 2012
  • Birmingham Pride 2012

Tag cloud

APIs Apple Birmingham Business Conservatives CSS Development Entertainment Films Formspring Friends Google Hardware Health History Home International iPhone Javascript jQuery Labour Lifestyle and culture Linux Mac Manchester Microsoft Miscellaneous Motoring MySQL Networking News Notebook PHP Politics Rail Social networking Sport Technology Telecommunications Television Transport Travel United States University Work

Archives

  • ► 2020 (1)
    • July 2020 (1)
  • ► 2019 (1)
    • September 2019 (1)
  • ► 2018 (1)
    • July 2018 (1)
  • ► 2017 (1)
    • May 2017 (1)
  • ► 2016 (3)
    • October 2016 (1)
    • June 2016 (1)
    • May 2016 (1)
  • ► 2015 (1)
    • May 2015 (1)
  • ► 2014 (2)
    • June 2014 (1)
    • May 2014 (1)
  • ► 2013 (3)
    • September 2013 (1)
    • July 2013 (1)
    • April 2013 (1)
  • ► 2012 (9)
    • December 2012 (1)
    • September 2012 (1)
    • August 2012 (3)
    • June 2012 (2)
    • March 2012 (1)
    • January 2012 (1)
  • ► 2011 (17)
    • December 2011 (1)
    • November 2011 (1)
    • October 2011 (1)
    • June 2011 (2)
    • May 2011 (1)
    • April 2011 (6)
    • March 2011 (1)
    • February 2011 (3)
    • January 2011 (1)
  • ► 2010 (25)
    • November 2010 (2)
    • October 2010 (2)
    • September 2010 (2)
    • July 2010 (5)
    • June 2010 (4)
    • May 2010 (1)
    • April 2010 (1)
    • March 2010 (4)
    • February 2010 (2)
    • January 2010 (2)
  • ► 2009 (15)
    • November 2009 (1)
    • October 2009 (2)
    • September 2009 (2)
    • August 2009 (4)
    • July 2009 (1)
    • June 2009 (5)
  • ► 2008 (29)
    • September 2008 (2)
    • August 2008 (4)
    • July 2008 (3)
    • June 2008 (1)
    • May 2008 (3)
    • April 2008 (5)
    • March 2008 (3)
    • February 2008 (3)
    • January 2008 (5)
  • ► 2007 (29)
    • December 2007 (4)
    • November 2007 (3)
    • October 2007 (3)
    • September 2007 (4)
    • August 2007 (5)
    • July 2007 (4)
    • June 2007 (3)
    • May 2007 (2)
    • January 2007 (1)
  • ► 2006 (13)
    • December 2006 (1)
    • November 2006 (1)
    • October 2006 (1)
    • September 2006 (3)
    • August 2006 (1)
    • July 2006 (1)
    • June 2006 (1)
    • May 2006 (1)
    • April 2006 (2)
    • January 2006 (1)
  • ► 2005 (7)
    • December 2005 (1)
    • August 2005 (1)
    • July 2005 (1)
    • May 2005 (1)
    • April 2005 (1)
    • March 2005 (1)
    • January 2005 (1)
  • ► 2004 (7)
    • December 2004 (2)
    • November 2004 (1)
    • April 2004 (1)
    • February 2004 (1)
    • January 2004 (2)
  • ► 2003 (4)
    • October 2003 (2)
    • July 2003 (1)
    • February 2003 (1)
  • ► 2002 (4)
    • December 2002 (2)
    • June 2002 (1)
    • February 2002 (1)
  • ► 2001 (1)
    • July 2001 (1)

Links

  • eBay
  • Github
  • RSS feed
  • Twitter

Disclaimer

It is not my intention to cause offence through material posted to this site. However, since I am a person with strong opinions then I appreciate that this might happen from time to time. In such cases I apologise if readers feel offended by any content, but I will not, under most circumstances, apologise for the content itself.

All content and opinion posted on this site is my own responsibility and does not represent the position or opinion of my employer or any clients.

Site presented by SNWO

SNWO

Sections

  • Uncategorized (5)
Powered by WordPress and Anderson.
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Other optionsWhatever
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT