Search Results
Article: Fibers In PHP 8.1
… of a web page we could do something like this. function get_web_page($url) { $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_HEADER, …
Article: PHP IP To Location
… we can do with this is to encapsulate the iplocation class and make a URL to location converter. This essentially just converts the URL into an IP address and then creates an IpLocation_Ip object to do the lookup. class IpLocation_Url { /** * @var string The last IP address converted. */ public …
Article: PHP Class To Interact With is.gd API
… The is.gd URL shortening service is yet another site that converts a long URL into a small one, but is.gd differs in that it generally produces smaller URLs than others. The is.gd API doesn't require that you create an …
… wrote about recently on the site. The function originally found any URL strings within a larger string and turned them into links. The … thing, except that the link text has been shortened using the shortenurl() function. $longurl = "there is the new site …
… There are a few URL shortening services about, of which bit.ly is just one. However, it … to interact with the site. Not only is it possible to shorten URL's, you can also reverse them, find out information about the site … available in this class but the main two are shorten() to turn a URL into its bit.ly equivalent and expand(), which will do the exact …
… a nice little PostCode to geographical reference tool. Using a simple URL parameter I was able to give the site a PostCode and strip the … $ch = curl_init($uri); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output …
Article: PHP5 Filter Functions Part 1
… expressions to tell if a value is a number, a boolean or even a URL, you can just use these filter fucntions. The main functions that … }else{ echo 'Invalid Email'; }; The same thing can be done with a URL. $url = 'http://www.hashbangcode.com'; if( filter_var($url, …
… file. This file is basically a XML file containing a list of URLs. Most major search engines understand (and look for) this file, so … and made sure that the index action did not show the layout. The URLs are passed as an array to the view. class SitemapController … indexAction() { $this-> _helper-> layout()-> disableLayout(); $urls = array(array('loc'=> 'http://www.hashbangcode.com/', 'lastmod'=> …
Article: PHP Page Redirection
… tag being the amount of time to wait before the refresh. Adding the URL parameter into the content tells the browser to refresh to a different URL, essentially a redirect. <meta http-equiv="refresh" content="0;URL=http://www.hashbangcode.com" /> Here is the full version. $url = …
Article: Check Backlinks With PHP
… The following function takes two arguments, the first being the remote URL and the second is the URL you are checking for. The function works by doing a small amount of initial formatting on the URL you are checking for and then downloading the remote page in little …