Title: Can&#039;t use the function in php
Last modified: August 22, 2016

---

# Can't use the function in php

 *  [lyone](https://wordpress.org/support/users/davidly22/)
 * (@davidly22)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/cant-use-the-function-in-php/)
 * Thanks for providing such a fantastic plugin.
    Let me first say that I’m not 
   a very beginner at web development. So pardon my silly questions. I’ve been trying
   to call the function in the php code.
 * I tried to use the following code to test whether the code detects a phone or
   a desktop
 * <?php if (function_exists(‘wpmd_is_phone’) && wpmd_is_phone()) :?>
    This will
   show if there is a phone <?php else : ?> This will show if it is anything but
   a phone <?php endif; ?>
 * The above code works. However, as soon as I try to put an ad in between, in doesn’t
   work anymore. I suspect because is uses javascript and I have no clue about javascript.
 * Here is the code I’m using (it displays criteo ads with a fallback on adsense)
 * <?php if (function_exists(‘wpmd_is_phone’) && wpmd_is_phone()) :?>
 * <script type=’text/javascript’>
    <!–//<![CDATA[ document.MAX_ct0 =”; var m3_u
   = (location……. ….. //]]>–></script>
 *  <?php else : ?>
 * Another ad
 *  <?php endif; ?>
 * The above code doesn’t work. I tried to put a ‘ before the script but it wouldn’t
   work.
 * Any help would be much appreciated!
 * [https://wordpress.org/plugins/wp-mobile-detect/](https://wordpress.org/plugins/wp-mobile-detect/)

The topic ‘Can't use the function in php’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-mobile-detect.svg)
 * [WP Mobile Detect](https://wordpress.org/plugins/wp-mobile-detect/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-mobile-detect/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-mobile-detect/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-mobile-detect/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-mobile-detect/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-mobile-detect/reviews/)

## Tags

 * [ads](https://wordpress.org/support/topic-tag/ads/)
 * [detect](https://wordpress.org/support/topic-tag/detect/)
 * [mobile](https://wordpress.org/support/topic-tag/mobile/)

 * 0 replies
 * 1 participant
 * Last reply from: [lyone](https://wordpress.org/support/users/davidly22/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/cant-use-the-function-in-php/)
 * Status: not resolved