Category: PHP Tutorial

How to Create a File in PHP

File Create The fopen function needs two important pieces of information to operate correctly. First, we must supply it with the name of the file that we want it to open. Secondly, we must tell the function what we plan on doing with that file (i.e. read from the file, write information, etc). Since we

PHP Strings

PHP Strings variables are used for values that contain character strings. A string can be used directly in a function or it can be stored in a variable. For example The output of the code Hello World The Concatenation Operator There is only one string operator in PHP. The concatenation operator (.) is used to

PHP variables

Variables PHP variables are used for storing a values, like text strings, numbers or arrays. When a variable is set it can be used over and over again. Variables in PHP are represented by a dollar sign followed by the name of the variable. The variable name is case-sensitive. The correct way of setting a

How to upload files in php

This example explains how to upload files in PHP. PHP makes uploading files easy. You can upload any type of file to your Web server. But with ease comes danger and you should be careful when allowing file uploads. In spite of security issues that should be addressed before enabling file uploads, the actual mechanisms

PHP Date and Time Functions

PHP offers a few really nice functions to manipulate dates and times. With the functions built into PHP, you can easily pull individual parts of a date or time and use it or format it just about any way you want. strtotime() To start, you should really familiarize yourself with PHP’s strtotime() function. The strtotime()