You are here: Home » PHP

Category Archives: PHP

PHP Numeric Arrays

In Numeric arrays, Arrays can store numbers, strings and any object but their index will be represented by numbers so it is called Numeric arrays. By default array index starts from zero. We can define PHP Numeric Arrays in two ways. First Type to create Numeric Array in PHP Second Type to create Numeric Array Read More »

get browser info in php

To get browser information, create a function, here i am creating a function getBrowser(), in this with the help of $_SERVER[‘HTTP_USER_AGENT’] get information. Then with the help of preg_match,check platform. function getBrowser() will return User agent, name, version, platform, pattern. Use just below code for it. Read More »

JSON web service

To display data in json for web service, first create database connection. Select data from database and store data in a associative array, here i am store data in $row[]. Call header(‘Content-type: application/json’); for print data in JSON. Print data with json_encode. Read More »

fetch data without page refresh in php

To fetch data without page refresh, we have to use jquey. Suppose, you have to display a list of places according to Country selection. Call a function on onChange=”show_place();” on country selection. in show_place() function, get country id, create a page ajax_place.php, send country id on ajax_place.php. On ajax_product.php, fetch data according to country from database, here i am showing ... Read More »

Print selected area

Some time we have to print, only some selected area not all screen. To do it, we have to call selected area in a div and define its ID, in below example, i have define two div, first for which i have to print and second for which i don’t print. For printed div , i define its id divToPrint ... Read More »

Add more in PHP

To use add more in php, we have to create a function addlinks(), in this function we define field which we have to call on alllinks() function, here we call a test field with name all_part, define it in array. Also, call a function removelinks() to remove added link. Just create a php page and paste below code, You may ... Read More »

Tooltip in php

Some time we have to show some message on mouse over or click on some text, it is called tooltip. There are many ways to display data in tooltip, i am using one of it. Use just below code for tooltip. Read More »

Scroll To Top