Home  >  Article  >  Backend Development  >  How to use php to implement short URL jump

How to use php to implement short URL jump

*文
*文Original
2017-12-25 15:40:512351browse

How to use php to implement short URL jump? This article mainly introduces the implementation method of PHP short URL conversion, involving the operation skills of URLs and strings, and has certain reference value. I hope to be helpful!

From yesterday afternoon to now, I have overturned one information storage solution after another, from mysql to file_get_contents with unlimited memory, to fscanf for formatted input, and finally chose the more mature and stable read ini method.

The entire main program has only two files zipurl.php and index.php

zipurl.php file is as follows:

 
  
ZIP your URL  
  



## The #index.php file is as follows:

location.href="'.readfiles($str).'";';  
}  
main();  
//统计部分  
?>  
  
ZIP your URL  
  

Temporary file url.tmp:

aaaaa=http://baidu.com

Related recommendations:

Example analysis of how PHP implements simulated http requests

Example sharing of how PHP sends an array through http requests

php realizes that the member login registration page has html plus Session and Cookie

The above is the detailed content of How to use php to implement short URL jump. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn