PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and its cool for regular urls, but it wont accept a slash at the end, or even slash something, like http://www.example.com/index.php
any clues how to add support to that?
the regex i really wanted is like this:
(http(s):// or ftp://)[here could be letters, numbers, dots, dashes, slashes, etc]dot[here would accept letters only, 2 or 3 digits for endings like com, co, net, it, tk]{i dont know if numbers are needed, i've only seen extensions with 2 or 3 characters, and no numbers, please correct me}[and anything again, like whatever can come after the .com, .co .net, could be anything like extension.php?variable=value]
hope i make myself clear enough!
thanks in advance people
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
that is even worse than my regex, it will only require a http:// in front of it, it will validate "http://adsfkjchawuifhw"
Actually it is "better" for a URL which is what you asked for. A URL must start with a scheme (in this case http://) followed by a hostname (in this case adsfkjchawuifhw). So maybe you don't want to match URLs, but specific types of URLs or partial URLs?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.