strago Posted May 29, 2010 Share Posted May 29, 2010 $valid_url = filter_var($url, FILTER_VALIDATE_URL); if ($valid_url !== false && $valid_url !== null && preg_match('!^https?://!', $valid_url)) { $url = filter_var($url, FILTER_SANITIZE_URL); $permalink = filter_var($permalink, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED); if ($permalink !== false && $permalink !== null && preg_match('!^https?://!', $permalink)) { $permalink = filter_var($permalink, FILTER_SANITIZE_URL); I got php 5.1.6. filter_var requires php 5.2.0. Is there a way to change this code so it uses something else and works with php 5.1.6? Link to comment https://forums.phpfreaks.com/topic/203247-fatal-error-call-to-undefined-function-filter_var/ Share on other sites More sharing options...
trq Posted May 29, 2010 Share Posted May 29, 2010 There is no substitute for filter_var, you would need to write it yourself. Link to comment https://forums.phpfreaks.com/topic/203247-fatal-error-call-to-undefined-function-filter_var/#findComment-1064896 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.