Wednesday, June 29, 2016

Sorting a multidimensional associative array in PHP

This post explains how a multidimensional associative array in PHP can be sorted by value of one of the associative keys. It can also be described as sorting an array of arrays by the keys of sub-arrays. Let us understand the situation with an example. Suppose there is a PHP array shown in the PHP code below:
<?php
$multi_array = array(array('name' => 'Orange', 'code' => '18plkp', 'value' => 15),
                     array('name' => 'Apple', 'code' => '45jklp', 'value' => 49),
                     array('name' => 'Guava', 'code' => '48pyhp', 'value' => 169)
                    );
var_dump($multi_array);
?>

Wednesday, October 30, 2013

How to make a Google Map using javascript?

Today, it is common to use google maps to locate the places. There are mobile applications used in mobiles. On websites, the places are located on google maps. Those google maps are made using Google Maps API provided by Google. Here, we will see how to make a simple google map for a particular location using HTML, javascript and Google Maps API.

Sunday, September 15, 2013

URL data extraction like facebook - Simple script in PHP

When you enter a url, then the main data like title, logo, etc. of the page to which the url takes you, are shown. This is called URL extraction. The best example you can see is facebook. Go to facebook homepage, enter the url in its status box. As soon as you type the url ,it shows you the extracted contents of the page corresponding to the url typed.
Let's write a simple script in PHP to show URL extraction. Mainly it will be css, javascript and html. We will use only file_get_contents(url) function of PHP.
Here the code goes...............

Saturday, September 14, 2013

Joomla 3 installation problem on WAMP server version 2.4

A few days back, I installed WAMP 2.4 on Windows 8 (64 bit). Then I started installing Joomla 3 (latest version at that time) on this operating system. Now, the installation got stuck at the database creation. At first look, it looked like that there might be some incompatibility between Joomla 3 and Windows 8. But the actual problem was with WAMP 2.4 as I searched for the solutions.

In fact, the problem was with PHP version 5.4 which comes by default in WAMP 2.4.

So, at first look, the solution might be like this:
  • Download the 2.2 version of Wamp Server 32 bit or 64 bit depending upon your windows. 
  • Install it. Then install Joomla 3 , if will become a piece of cake for you now.
If you don't want to compromise on PHP version, then there is another solution available.
Just try this out.
  • Go to wamp\www\joomla folder\installation\sql\mysql and open joomla.sql file.
  • Find the term "ENGINE=InnoDB" and replace all with "ENGINE=MyIsam".
The reason that this trick works is that MyIsam is more supported and compatible with Joomla.

Hope you will like the post. Thanks for reading it.

Monday, September 9, 2013

URL Rewriting A Brief Introduction

Hello everyone,
these days you see many urls on different sites shown as some shortened random text. We may call them shortened urls which are made to function correctly by using URL Rewriting on the server on which the target website is hosted. This is just one example where URL rewriting is used. Many other usages are also there. Let's have a brief introduction of this technique below.