php
PHP -Regular Expressions

Regular expressions are a powerful tool for examining and modifying text. Regular expressions themselves, with a general pattern notation almost like a mini programming language, allow you to describe and parse text. They enable you to search for patterns within a string, extracting matches flexibly and precisely. However, you should note that because regular expressions […]
PHP $_SERVER

$_SERVER is a PHP super global variable which holds information such as headers, paths, and script locations. The entries in this array are created by the web server. There is no guarantee that every web server will provide any of these; servers may omit some, or provide others not listed here. The following table lists […]
PHP Login Page Example

This post for PHP beginners Login Page Example. I want to explain creating database, posting form values, storing the session value and destroy the session. It’s is very useful and simple.1. DatabaseMySQL admin table columns id, username, passcode. CREATE TABLE admin(id INT PRIMARY KEY AUTO_INCREMENT,username VARCHAR(30) UNIQUE,passcode VARCHAR(30)); 2. Config.phpDatabase configuration file. <?php $mysql_hostname = “localhost“;$mysql_user = “user“;$mysql_password = “password“;$mysql_database = “db“;$bd = mysql_connect($mysql_hostname, […]
Create a Date With PHP

Create a Date With PHP mktime() The optional timestamp parameter in the date() function specifies a timestamp. If you do not specify a timestamp, the current date and time will be used (as shown in the examples above). The mktime() function returns the Unix timestamp for a date. The Unix timestamp contains the number of seconds between […]
The PHP Date() Function

The PHP date() function formats a timestamp to a more readable date and time.Syntax : date(format,timestamp). Parameter Description format Required. Specifies the format of the timestamp timestamp Optional. Specifies a timestamp. Default is the current date and time Get a Simple Date The required format parameter of the date() function specifies how to format the date (or time). […]
PHP, Rounding and Formatting Numbers
1. Round () – Rounding Numbers The PHP function round () is used to round numbers up or down based on their value (Any decimal .5 or above is rounded up, anything under .5 is rounded down.) You can specify how many decimals you would like the number rounded to. It is phrased as round […]