17 articles PHP

File/Directory

How to create New file and open Existing file The fopen() function is used to create new file and also open existing file. Syntax:- fopen(“filename”,”mode”); Mode Description r read only w write only a append Some Usefull File Handling Function are: fclose() This function closes the opening file. Return type bool. Syntax:- $file=fopen(“myfile.txt”,”r”); fclose($file); fwrite()…

PHP Upload/Download

How to upload file on the server ? First create html form for file upload on the server. Code <form action=”” method=”post” enctype=”multipart/form-data”> Filename:<input type=”file” name=”userfile” /><br /> <input type=”submit” name=”submit” value=”Submit” /> </form> Note:- enctype=”multipart/form-data” attribute is necessary. File upload on server side When we submit the form. Then $_FILES superglobal variable is created.…

PHP INCLUDE

INCLUDE is used in PHP to append the code from an external file into the current file. The syntax for INCLUDE is This is a convenient feature for a large website. Often, we may want to change an element of the website that is consistent across the entire site, yet we don’t want to go…

PHP DATABASE

What is DataBase In database we store our data. Like MSExcel etc. But MSExcel is not DataBase software. DataBase Software are Mysql, Oracle,Sybase etc. Main benefit of database software is that user can reterive data as per requirement. There is no need to see whole data. By DataBase data duplication will be remove. And many…

PHP String

PHP string functions are used to manipulate string data.a string is series of characters, where a character is the same as a byte. This means that PHP only supports a 256-character set, and hence does not offer native Unicode support The most common string functions include the following PHP addslashes Function: Adds slashes to specified…

PHP LOOP

What is loop?. Loop execute some statement many times till the condition is fullfill. loop has three type. these loops do same work execute statement many times. 1. While loop 2. Do while loop 3. For loop while loop In the while loop it first check the condition then body of the loop will be…

PHP Array

Why need Array? An array is a special variable,Suppose we want to store 100 data item. So we need 100 different variable. So this is very typical work for programmer to manage 100 different variable.To overcome this problem we create a special type variable known as array. Suppose we want to store 100 data item.…

PHP Installation

Why PHP? PHP runs on different platforms (Windows, Links, Unit, etc.) PHP is compatible with almost all servers used today (Apache, IIS, etc.) PHP is FREE to download from the official PHP resource: wafting PHP is easy to learn and runs efficiently on the server side Reduce the time to create large websites. Create a…