Php checks whether there is an external link in the string. it is a php string. Php checks whether there is an external link in the string. The php string example in this article describes the php checks whether there is an external link in the string. Share it with you for your reference. The specific implementation method is as follows: php checks whether there is any external link in the string, and php string
This example describes how to check for external links in strings in php. Share it with you for your reference. The specific implementation method is as follows:
/*** Is_external_link: Check whether the string contains External links * @ param string $ text * @ param string $ host domain name * @ return boolean false there is external link true no external link */function all_external_link ($ text = '', $ host = '') {if (empty ($ host) $ host = $ _ SERVER ['http _ host']; $ reg = '/HTTP (? : S ?) :\/\/((? : [A-za-z0-9-] + \.) + [A-za-z] {2, 4})/'; preg_match_all ($ reg, $ text, $ data); $ math = $ data [1]; foreach ($ math as $ value) {if ($ value! = $ Host) return false;} return true ;}
I hope this article will help you with php programming.
Examples in this article describes how php checks whether strings contain external links. Share it with you for your reference. The specific implementation method is as follows...