Home >Backend Development >PHP Tutorial >PHP obtains the real address of the jump instance_PHP tutorial
There are many short URL applications now. Clicking will jump to the URL before shortening. So today we will take a look at how to get the URL before short URL jump with PHP. It is actually very simple, just use PHP. get_headers function,
get the Response Headers, and then analyze it slowly.
Give specific implementation methods:
The code is as follows
|
Copy code
|
||||
$header = get_headers($url, 1);
|
if (is_array($header['Location'])) {
}