Php Programs

These PHP basic programs will help you to understand the basic programs in PHP.

File Upload in PHP

Program to file upload in php example. uploading files to a server is a simple process. PHP makes it easier to upload files to a server by providing some unique features. PHP allows you to upload single or multiple files with ease. PHP allows you to upload both binary and text files. Other functions and …

File Upload in PHP Read More »

Get Current Date in PHP

Program to get current date in php. The date() function’s required format parameter specifies how to format the date. The date() function in PHP is used to format the date and time. A timestamp can also be formatted with the date() method. A timestamp is a string of characters that represents the date and/or time …

Get Current Date in PHP Read More »

Decrement Number in PHP

Simple program to execute decrement number in php. In this program we can print the number using the post decrement operator. A post-decrease operator is used to decrement the value of a variable after executing the expression in which the operator is utilised. The variable’s value is used in an expression before being decremented using …

Decrement Number in PHP Read More »

Pre Decrement in PHP

Simple program to pre decrement in php. In this program, we can print the number. The increment operator is used to increase the value by one, while the decrement operator is used to decrease the value by one. The increment operator reduces a value by one. Pre Decrement Operator in PHP PHP supports pre- and …

Pre Decrement in PHP Read More »

Post Increment in PHP

Simple program to post increment in php. In this program we can print the output using post increment operator. The term “post-increment” refers to the process of increasing a number. The value of the variable is increased after it has been assigned to it. Post Increment Operator in PHP The post-increment operator is used to …

Post Increment in PHP Read More »

Pre Increment in PHP

Simple program to execute the pre increment in php. In this program we can increment the value in previously using operator. Before utilising a variable in an expression, a pre-increment operator is used to increase its value. The value is first increased and then used inside the expression in the Pre-Increment. PHP Increment Operator PHP …

Pre Increment in PHP Read More »

Rand Function in PHP

Simple program to generate rand function in php. In this we can print the random from the user-defined value. This allows us to output the random number generated from a user-defined value.  The rand() function in PHP is used to generate a random number. (syntax) rand () Use the rand() method to generate a random …

Rand Function in PHP Read More »

Round PHP Function

Round PHP Function. In this program, we can print the number with rounded value as output.  The round() method in PHP has three parameters: number, precision, and mode, the latter two of which are optional. The rounded value of the argument supplied is returned by the round() method. Float Datatype in Php A float is …

Round PHP Function Read More »

Pi Function in PHP

Pi Function in PHP. In this program we can print the value of pi using the function pie. Because Pi is an irrational number, it cannot be stated in the form of p/q. However, we proclaim Pi as 22/7 because to find the area or circumference of a circle, we only need the first three …

Pi Function in PHP Read More »

strpos Function in PHP

strpos Function in PHP. Using this program we can search the string in group of text. The strpos() method determines the position of a string’s first occurrence within another string. The strpos() function returns the position of a string, while the stripos() function does the same thing but in a case-insensitive manner. Both return the …

strpos Function in PHP Read More »

Decbin Function in PHP

Decbin Function in PHP. A Php program to print the number using decbin. In this program, we can print the number using decbin for beginners in PHP. In PHP, the decbin() method returns a string that contains a binary version of the supplied decimal number argument. The term decbin refers to the conversion of decimal …

Decbin Function in PHP Read More »

Floor Function in PHP

Floor Function in PHP. A Php program to print the number using the floor method. By using this method we can execute the program with floor function. Another built-in function in PHP interpreter is the floor() function. Any float number can be passed as an argument, and it will be rounded down to the next …

Floor Function in PHP Read More »

Program to Print Alphabet Triangle Using range() Function in PHP

Program to Print Alphabet Triangle Using range() Function in PHP. A Php program to alphabet triangle using range() method. The range() function is a PHP built-in function that creates an array of elements of any kind, such as integers and alphabets, within a particular range (from low to high), i.e. the list’s first entry is …

Program to Print Alphabet Triangle Using range() Function in PHP Read More »

Swapping of Two Numbers in PHP Without Third Variable

Swapping of Two Numbers in PHP Without Third Variable. This program will swap the two numbers in the PHP scripting language. This program will print the result after interchanging the values in output  screen in php language.  The act of swapping two variables in computer programming refers to the exchange of the variables’ values. This is usually …

Swapping of Two Numbers in PHP Without Third Variable Read More »

Hello World Program in PHP

Hello world program in php. Php program to print hello world program is a computer program that emits or displays the message “Hello, World!”. Such a program is fairly easy in most programming languages, and it is frequently used to teach a programming language’s basic grammar. It is frequently the first program written by those …

Hello World Program in PHP Read More »