Category Archive for "PHP"

Database Connection in php

By using below code you can connect database with php application. After database connection we can access all database and also we can CRUD operation by using PHP application. $servername = “localhost”; $username = “username”; $password = “password”; // Create…

Read More

generate png image using php

To create image using php you can use below code $img = imagecreatetruecolor(200, 200); imagesavealpha($img, true); $color = imagecolorallocatealpha($img, 0, 0, 0, 127); imagefill($img, 0, 0, $color); imagepng($img, ‘test.png’);

Read More

How To Make The Star Triangle In Php?

Write code that will print the following: * ** *** **** ***** for($i=0;$i

Read More

Insert, update, and delete in php

Read More

How to sort array in php

$cars=array(“Jems”,”Vijay”,”Alpesh”,”Yogi”); sort($cars); $clength=count($cars); for($x=0;$x<$clength;$x++) { echo $cars[$x]; echo “<br>”; }

Read More

PHP Interview Question

1. Who is the father of PHP ? Rasmus Lerdorf is known as the father of PHP. 2. What is the difference between $name and $$name? $name is variable where as $$name is reference variable like $name=sonia and $$name=singh so...
Read More