Using PHP to call the tinyurl API

Source: Internet
Author: User
Tags php source code

Introduction: This is a detailed page for using PHP to call the tinyurl API. It introduces PHP, related knowledge, skills, experience, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 323144 'rolling = 'no'>

Tinyurl is a Web service that shortens the URL. You can change a long URL to a simple URL. Generally, you can create a tinyurl on its homepage, sometimes users automatically generate tinyurl on the client. Here we will introduce a method to use PHP to call tinyurl to generate a shortened address.

The PHP functions of tinyurl API are as follows:

Reference content is as follows:

<? PHP
Function tinyurl ($ U ){
Return file_get_contents ('HTTP: // tinyurl.com/api-create.php? Url = '. $ U );
}
?>

The call example is

Reference content is as follows:

<? PHP
$ Url = 'HTTP: // www.william long.info /';
$ Tiny = tinyurl ($ URL );
Echo ('the tinyurl of "'. $ URL.'" is "'. $ tiny .'"');
Die ();
?>

More articles about "using PHP to call tinyurl API"

Love J2EE follow Java Michael Jackson video station JSON online tools

Http://biancheng.dnbcw.info/php/323144.html pageno: 16.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.