How-to articles, tricks, and solutions about URL

Get file content from URL?

To get the contents of a file from a URL in PHP, you can use the file_get_contents function.

Get URL query string parameters

To get the query string parameters in PHP, you can use the $_GET superglobal array.

How to Create URL Slug from String in PHP

Here is a short tutorial that will represent to you the way of creating a URL slug from string with PHP. It should be an essential part of any website.

How to Get Parameters from a URL String with PHP

Learn how to get the parameters from a URL string in PHP with the help of our short tutorial. Read on and check out the helpful examples below.

How to Get Query Parameters from a URL in Vue.js

Read this short Vue.js tutorial and learn a super easy method that is used to get the query parameters from the URL. Also, read about query parameters.

How to Pass an Array in URL Query String with PHP

In this short tutorial, you will find the way of passing an array in URL query string using PHP.

How to Redirect a Web Page with PHP

In PHP, you can use several functions to make a redirect from one web page to another. Learn how to do it accurately with W3docs.

How to Remove Hashbang from URL in Vue.js

Read this short Vue.js tutorial and learn which method you should use to easily get rid of the hashbang from the URL while using a Vue.js application.

How to Use the filter_var() Function in PHP

Let’s dive deeper into the world of PHP. Here, we are going to discover the filter_var() function. Let’s see for what purposes it can be used in PHP.

How to Validate URL with PHP

In this snippet, we provide guidelines on one of the most common issues in PHP. Here, we show the most straightforward way on how to validate URL with PHP.

Java URL encoding of query string parameters

To URL encode the query string parameters of a URL in Java, you can use the URLEncoder class from the java.net package.

Passing multiple variables to another page in url

There are several ways to pass variables from one PHP page to another.

PHP check if url parameter exists

To check if a URL parameter exists in PHP, you can use the isset function.

PHP ini file_get_contents external url

To use the file_get_contents function to retrieve the contents of an external URL in PHP, you will first need to ensure that the allow_url_fopen directive is enabled in your php.ini file.

Post Requests with cURL

cURL is applied for making requests with different protocols. A post request can send user collected data to a server. Find out how to do that accurately.

Proper URL forming with a query string and an anchor hashtag

To form a proper URL with a query string and an anchor hashtag in PHP, you can use the http_build_query() function to create the query string and concatenate it to the base URL using the ?

Request string without GET arguments

In PHP, you can use the $_SERVER['REQUEST_URI'] variable to get the request string without GET arguments.

Simplest way to read JSON from a URL in Java

To read JSON from a URL in Java, you can use the readJsonFromUrl() method from the JSON simple library.