To make browser show pdf file, we can use html embed or open a pdf url by browser. However, these two methods of displaying pdf file is hard to make some control, for example, if we only want to valid user to read pdf, how to control? To do this, we need output pdf file by php script. In this tutorial, we will show you how to do.
When we open a url by our browser, the browser will use http get method to send a request. However, if you only want to allow http post method, how to do? In this tutorial, we will introduce you how to set a php page only receive http post method request.
WebP image is a popular image format using in web development. In this tutorial, we will discuss what its mime type is and how to output is to our browser using php directly.
When you are using your browser to open a html or txt file, they will be opened by our broweser and not downloaded into your computer. In this tutorial, we will introduce you how to download them, not open them by using php.
Enable chrome reader mode can make us to view web page like an ebook, which is very helpfu us to void some ads. In this tutorial, we will tell you how to enable it.
Getting file extension can allow us to apply different operation by file extension. For example, you should set different http header by image extension. In this tutorial, we will write a simple example to show you how to get file extension easily by using php.
To calculate a directory size in php, there are some methods:1.If you are using windows system, you can use php to parse dir command. Meanwhile, if your pc is linux, you also can parse du command. 2.Iterate size of all files in this directory and sum them. In this tutorial, we will introduce using method 2 to calculate a directory size using php.
In this tutorial, we introduce how to use bigdump.php to import very large sql file into mysql database, it is very useful to every webmasters and you can learn how to use it by following our tutorial.
In this tutorial we write a php function compress($src, $dest, $quality=50) for compressing images, you can use it to compress images in php application by following our steps.