Expert Shout Blog

How to output or print the array results in php 0

How to output or print the array results in php

To print an array result using var_dump() <?php $a = array(1, 2, array(“a”, “b”, “c”)); var_dump($a); ?> Note: var_dump() is used to dumb the information about the variable output array 0 => int 1 1 => int 2 2 =>...

How to include Captcha in php program / script 0

How to include Captcha in php program / script

sample captcha code //captcha.php <?php session_start(); if(isset($_REQUEST[‘submit’])) { if(isset($_REQUEST[“captcha”])&&$_REQUEST[“captcha”]!=””&&$_SESSION[“code”]==$_REQUEST[“captcha”]) { echo “Correct Code Entered”; //Do you stuff } else { echo “wrong code try again”; } } ?> <html> <body> <form action=”captcha.php” method=”post”> Enter...

Php script or program to find square root of a given number 0

Php script or program to find square root of a given number

Simple program to find square root of a given number <?php $num=9; $root=0; $odd=1; while($num>0) { $num-=$odd; $root++; $odd+=2; } echo $root; ?> output  3 Program to find square root of a given number...

PHP script to find the odd or even numbers 0

PHP script to find the odd or even numbers

Here, we find simple php script to find the given number is odd or even. These are the basic programs used during PHP training for students. Simple program to find odd or even number...

How to install, setup and configure Wamp server 0

How to install, setup and configure Wamp server

WAMP WAMP is an acronym, where W stands for Windows, A stands for Apache, M stands for MYSQL,  P stands for PHP, which refers to set of open source application combined with microsoft windows, which...

how to install set up or configure Xampp server 0

how to install set up or configure Xampp server

XAMPP XAMPP is an acronym, where X stands for cross platform or any other operating system ,where A stands for Apache, M stands for MYSQL,  P stands for PHP and P stands for Perl. XAMPP...

How to get random number in php program or script 0

How to get random number in php program or script

To get a random number using PHP function rand() function generates the random number Here is the code to print the random numbers from 1 t0 19 using array <?php $arr = array(1, 20,...

How to Optimise mysql queries, importance of closing db connections 0

How to Optimise mysql queries, importance of closing db connections

How to optimize MYSQL queries The MYSQL query optimization takes the advantages of indexes, but it is also uses other information.For example, if we use the following query, MYSQL will execute it very quickly,...