Title: PHP Syntax Question
Last modified: August 21, 2016

---

# PHP Syntax Question

 *  [doclalor](https://wordpress.org/support/users/doclalor/)
 * (@doclalor)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/php-syntax-question-2/)
 * I posted on the author’s site, and I understand that he cannot respond to questions
   about PHP shortcode. But perhaps someone in the wider WordPress community would
   help me with this one:
 * > The variable in `$phil_img` is the url to a GIF image. It works fine in url
   > building, and populating `<img ...>` tags, etc… But I am trying to code in 
   > a conditional test:
   > IF there is no GIF image, THEN I want to use a default “generic.gif”.
   > But I’m having trouble getting the syntax for conditionals that is parsed properly
   > by the plugin.
   > **_Should_** the following work? (It does **_not_**.)
   > `if(!file_exists($phil_img)) { return 'That is not a file.'; }`
   > Thanks for any pointers.
   >  ~Brendan
 * [http://wordpress.org/extend/plugins/shortcode-exec-php/](http://wordpress.org/extend/plugins/shortcode-exec-php/)

The topic ‘PHP Syntax Question’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/shortcode-exec-php.svg)
 * [Shortcode Exec PHP](https://wordpress.org/plugins/shortcode-exec-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcode-exec-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcode-exec-php/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcode-exec-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcode-exec-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcode-exec-php/reviews/)

## Tags

 * [conditionals](https://wordpress.org/support/topic-tag/conditionals/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 0 replies
 * 1 participant
 * Last reply from: [doclalor](https://wordpress.org/support/users/doclalor/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/php-syntax-question-2/)
 * Status: not a support question