Category: PHP Tutorials

How to connect two different Database in a PHP Class – Simple Script

How to connect two different Database in a PHP Class – Simple Script

Sometimes you may need to connect two different databases for a project and you may feel difficult to do that right?.

Don’t worry it’s really simple if you are using a PHP Class in your project.


private static function _connectDB1()
Very Simple jQuery and PHP Ajax Request – Ready to use code

Very Simple jQuery and PHP Ajax Request – Ready to use code

Are you wondering how to do an Ajax call through jQuery Script?.

Here I’m going to teach you a very very simple way of writing a jQuery script to fetch the records from the database.

Download the script at the

How to display data from a MySQL database – PHP Script

How to display data from a MySQL database – PHP Script

PHP is a widely used and easiest language in the world.

It’s very simple to display the data from a MySQL table to a webpage using PHP scripting.

First, you need to create a database and a table in MySQL. …

How to do Search engine Friendly URL through htaccess ReWriteRULE

How to do Search engine Friendly URL through htaccess ReWriteRULE

PHP is the vast programming used for developing websites. You might have seen hundreds of website URL having with a lot of query string in it.

For Example:

https://babynames.agurchand.com/index.php?origin=African&gender=male&type=chaldean&page=4

If you see the above URL it looks ugly and with …

Euler’s Prob.2 – PHP Program to find the sum of the even-valued terms in the Fibonacci

Euler’s Prob.2 – PHP Program to find the sum of the even-valued terms in the Fibonacci

PHP script for the Euler’s Problem 2.

Question:

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:

1, 2, 3, 5, 8, …

How to reverse a string without using Loops and Builtin Function in PHP

Do you know how to reverse a string without using any loops or built in function in php?

There is an amazing recursive function will do this magic trick.

See the below lines of codes:


<?php

function myreverse($str)
{
return 

How to reverse a string without using Builtin Function in PHP

You wonder how to reverse a String without using a Built in Function strrev() in PHP?.
This question asked many times in Interviews.

I got a solution here.

Just see the below lines of codes.


<?php
$str = "SPIDERMAN";
$len 
Theme: Overlay by Kaira
Agurchand