Solve the problem that the website URL format is too long

Source: Internet
Author: User
Recently, I am helping my friends develop a brand new website. it was designed to be concise and easy to access. As a result, it is not very considerate and not very satisfied with some designs. For example, website navigation, comments, and communities still need to be improved. However, I have summarized some PHP application skills during the development process and would like to share them with you. Recently, I am helping my friends develop a brand new website. it was designed to be concise and easy to access. As a result, it is not very considerate and not very satisfied with some designs. For example, website navigation, comments, and communities still need to be improved. However, I have summarized some PHP application skills during the development process and would like to share them with you.

First, the first example fully demonstrates that the combination of simple REST APIs and SimpleXML has a practical effect.

For a long time, I have been used to using FeedBurne because it clearly shows the number of registered users. As part of this website design, I hope to get this number without using an image. Enter the FeedBurner Awareness API and run the following two-line PHP command:

Feed-> entry ['circulation'];?>

When the URL length is too long, the format is not easy to grasp. At this time, the best solution is to shorten the URL length, and the most moderate URL length is the first X characters and the last Y characters. As follows:

$ Max_length) {$ first_chunk = substr ($ url, 0, $ first_chunk_length); $ last_chunk = substr ($ url,-$ last_chunk_length); return $ first_chunk. $ separator. $ last_chunk;} return $ url;} $ url = 'http: // averylongdomainname.org/a/very/long/path/to/averylongfilename.pdf'; $ short_url = shorten_url ($ url );

In this way, you can connect to $ url and display $ short_url. You can also clearly see the link.

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.