By reading the API, it appears that http_build_str() does not URL encode the parameters, while http_build_query() does. http_build_str() also can take either an object OR an object as its primary argument, while http_build_query() only takes an array.
Category Archives: PHP
Sort Multi-dimensional Array by Value
How can I sort this array by the value of the "order" key? Even though the values are currently sequential, they will not always be.
PHP Redirect 301 permanently
Sometimes you might want to redirect your visitors to a new URL address. This article will show you how to make a PHP redirect using the 301 "moved permanently" redirection. This is the one you should use as it is the most search engine friendly. Like the name suggests, PHP redirect tells the browser (or …
Creating a PHP REST Routing Class for Your Application
The main features typically are: REST Routing Use different HTTP methods for same URL’s to determine different types of action / request Support dynamic URL segments Provide the capability for reverse routing; creating the destination URL from an array of route variables SEO friendly URL’s using a .htaccess to route all URL’s into your class
Google Chrome PHP log console
Overview ChromePhp is a PHP library for the Chrome Logger Google Chrome extension. This library allows you to log variables to the Chrome console.
How to Upload and Unpack a Zip File using PHP
When you’re emailing or uploading larger files, it always makes sense to compress them first. This decreases file size and also helps avoid file corruption during transfer. The most common compressed file you will encounter is the zip file, since most operating systems come with a basic utility to quickly zip and unzip files. Creating …
Continue reading “How to Upload and Unpack a Zip File using PHP”