Sometimes clients need to edit their CSS to make design changes and you have to implement a mechanism in website admin to get CSS, edit it and save it. You can do it in several ways but here is popular one like WordPress use while theme editing. Here it is.
Uploading images in PHP… I store image name and size (width, height) in DB to retrieve later to use. Here is a script that will enable you to get image width and height in PHP. You can use this script in image upload forms.
With this PHP script you can find size and type (extension) of required file.
I have other solutions to find file path at server or file name using PHP. The thing is, some php scripts might not work with some versions of PHP or in some situations. So more methods you learn for each task with PHP, the better. Here goes more solutions; Enjoy! In this example I used […]
File append means to add on to the existing data, then you need to open the file in append mode.
When you view the contents of a directory you can see all the files that exist in that directory because the operating system or application that you are using displays a list of filenames. You can think of these filenames as links that join the files to the directory you are currently viewing. If you […]
We have to use the function fopen to open the file for reading. Here’s the code to read-open the file.
Now that you know how to open and close a file, lets get on to the most useful part of file manipulation, writing! There is really only one main function that is used to write and it’s logically called fwrite.
The next logical step after you have opened a file and finished your business with it is to close that file down. You don’t want an open file running around on your server taking up resources.
These three basic ways to open a file have distinct purposes. If you want to get information out of a file, like search an e-book for the occurrences of “cheese”, then you would open the file for read only. If you wanted to write a new file, or overwrite an existing file, then you would […]