Category Archives: PHP

PHP – Coding Standards

In any programming language, it is important that we follow a particular standard or protocol. This allows different developers or coders to remain on the same page as their peer developers. It makes the code understandable and manageable. There are many reasons that influence developers to stick to these standards. Following the same coding standard allows your team… Read More »

PHP – File Uploading

You can upload a file to the server by using a PHP script with HTML forms. Before uploading the file to the original destination it gets uploaded to a temporary directory by a PHP script. The temporary directory information is mentioned in the phpinfo.php page which is specified as upload_tmp_dir. You can mention the maximum size for the… Read More »

PHP – Sessions

PHP sessions allow you to access data among different pages of an entire website. A temporary file has been created by the session that is stored at the server along with its data and the session variables and the information will be then available to all pages. You can decide where to store this session file by setting… Read More »

PHP – Cookies

PHP – Cookies Cookies are files that are used for tracking and are stored on the client’s computer. PHP supports cookies that keep tracks of their returning users. The server sends the cookies that may contain information to the browser. All the sent information is then stored at the local system by the browser. If the user comes… Read More »

PHP – Files & I/O

PHP – Files & I/O PHP allows you to perform some file functions like opening a file, reading a file, writing a file and closing a file from within the program. 1. Opening and closing file PHP supports the use of fopen() function to open a file that takes two parameters to be passed. The first parameter is… Read More »

PHP – File Inclusion

PHP – File Inclusion PHP supports the use of two functions that allows you to put the content of one PHP file to another PHP file. After the inclusion, the file get executes by the server. The two functions are: include() function require() function Using this feature of PHP you can easily use different functions, headers or elements… Read More »

PHP – Get and Post

PHP – Get and Post PHP allows you to create an environment variable that can be set by phpinfo.php page. HTTP_USER_AGENT is an environment variable provided by PHP that identifies the browser and the operating system. HTTP_USER_AGENT variable creates dynamic content based on the contained information. The value of these environment variables can be accessed via getenv() function.… Read More »

PHP – Functions

PHP – Functions Functions can be defined as the block of the code or some set of instructions that executes by the PHP. these functions may or may not take parameters to pass to that code block. There are two types of functions that are supported by PHP. 1. Built-in functions As we all know that PHP has… Read More »

PHP – Strings

PHP – Strings Strings are considered as a sequence of characters. You can use the strings within single or double quotes, without quotes you will not be able to perform string operations. Even if you want an integer to represent as string you can enclose that integer within quotes, it will be typecast as a string. Both single… Read More »