Title: PHP Error
Last modified: August 24, 2016

---

# PHP Error

 *  Resolved [lifeofguenter](https://wordpress.org/support/users/lifeofguenter/)
 * (@lifeofguenter)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/php-error-130/)
 * I am trying to use the following PHP validation script:
 *     ```
       <?php
       if (!filter_var($value, FILTER_VALIDATE_URL)) {
           return false;
       }
       $scheme = parse_url($value, PHP_URL_SCHEME);
       if (empty($scheme)) {
           return false;
       }
   
       if ($scheme != 'http' && $scheme != 'https') {
           return false;
       }
       return true;
       ```
   
 * But I am getting each time an error T_STRING unexpected “http”.
 * [https://wordpress.org/plugins/validated-field-for-acf/](https://wordpress.org/plugins/validated-field-for-acf/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [doublesharp](https://wordpress.org/support/users/doublesharp/)
 * (@doublesharp)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/php-error-130/#post-5989507)
 * Hi [@lifeofguenter](https://wordpress.org/support/users/lifeofguenter/),
 * I just tested a text field validated with your code above, and it would fail 
   on random characters but I was able to successfully submit “[https://www.test.com&#8221](https://www.test.com&#8221);.
 * Can you let me know what version of PHP, WordPress, ACF, and Validated Field 
   you have? It may be something specific to your installation.
 * Thanks!
 * Justin
 *  Thread Starter [lifeofguenter](https://wordpress.org/support/users/lifeofguenter/)
 * (@lifeofguenter)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/php-error-130/#post-5989548)
 * Hi,
 * Thanks for having a look at it:
 * PHP:
 *     ```
       PHP 5.4.39 (cli) (built: Mar 28 2015 13:43:56)
       Copyright (c) 1997-2014 The PHP Group
       Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
           with XCache v3.2.0, Copyright (c) 2005-2014, by mOo
           with the ionCube PHP Loader v4.6.1, Copyright (c) 2002-2014, by ionCube Ltd.
           with XCache Cacher v3.2.0, Copyright (c) 2005-2014, by mOo
       ```
   
 * WordPress 4.1.1 – ACF and Validated Field are latest.
 *  Plugin Author [doublesharp](https://wordpress.org/support/users/doublesharp/)
 * (@doublesharp)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/php-error-130/#post-5989573)
 * The code you provided works for me. Slightly different version of PHP at 5.4.37,
   and I’m not using XCache. I’m assuming you are on the latest of ACF 5?
 * Have you tried with other plugins disabled? Where exactly do you see the PHP 
   error – the log or the AJAX request?
 *  Plugin Author [doublesharp](https://wordpress.org/support/users/doublesharp/)
 * (@doublesharp)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/php-error-130/#post-5989723)
 * [@lifeofguenter](https://wordpress.org/support/users/lifeofguenter/) pinging 
   you to see if you are still having issues. since i am not able to reproduce this
   issue with the latest version of the plugin, I will mark it resolved if I don’t
   hear back. Thanks!
 *  Plugin Author [doublesharp](https://wordpress.org/support/users/doublesharp/)
 * (@doublesharp)
 * [11 years ago](https://wordpress.org/support/topic/php-error-130/#post-5989731)
 * closing: unable to reproduce.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘PHP Error’ is closed to new replies.

 * ![](https://ps.w.org/validated-field-for-acf/assets/icon-256x256.png?rev=1116693)
 * [Advanced Custom Fields: Validated Field](https://wordpress.org/plugins/validated-field-for-acf/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/validated-field-for-acf/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/validated-field-for-acf/)
 * [Active Topics](https://wordpress.org/support/plugin/validated-field-for-acf/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/validated-field-for-acf/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/validated-field-for-acf/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [doublesharp](https://wordpress.org/support/users/doublesharp/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/php-error-130/#post-5989731)
 * Status: resolved