Thursday, December 16, 2010

PHP the fastest growing language or technology with Open Source Facility

 I think for new comer or fresher IT aspirants PHP is the greatest  platform to proof herself/himself. As we see there are lots of example in current scenario where php left behind all technologies the best example is open source CMS like Joomla , Drupal, Magento etc that make web developement easier and faster. Apart from these benefits any individual can  work and earn money using these technologies. So I'll suggest all the new comer come to become the part of PHP Development.

Best wishesh,
Mohammad Tabrez Ansari
Applicaiton Engineer

Wednesday, December 8, 2010

Using PHP simple script that parses XML to HTML code for anyone who needs to put weather forecast on their websites

Using PHP simple script that parses XML to HTML code for anyone who needs to put weather forecast on their websites
<?php
$xml = simplexml_load_file("http://www.google.com/ig/api?weather=milan");
$day=array();
$low=array();
$high=array();
$icon=array();
$condition =array();
$humidity=array();
$wind_condition=array();
$googlePath="http://www.google.com";

 foreach($xml->children() as $child)
 {
   
     foreach($child->children() as $schild)
          {
                 
                if($schild->getName()!=" ")
                {
                    if( $schild->getName()=="forecast_conditions")
                    {
               
                        foreach($schild->children() as $sschild)
                          {
                             
                                if( $sschild->getName()=="day_of_week")
                                {
                                    $day[]= $sschild['data'];
                                }
                                if( $sschild->getName()=="low")
                                {
                                    $low[]= $sschild['data'];
                                }
                                if( $sschild->getName()=="high")
                                {
                                    $high[]= $sschild['data'];
                                }
                                if( $sschild->getName()=="icon")
                                {
                                    $icon[]= $sschild['data'];
                                }
                                if( $sschild->getName()=="condition")
                                {
                                    $condition[]= $sschild['data'];
                                }
                               
                          }
                    }
                   
                    if( $schild->getName()=="current_conditions")
                    {
                        foreach($schild->children() as $sschild)
                          {
                              if( $sschild->getName()=="humidity")
                                {
                                    $humidity= $sschild['data'];
                                }
                               
                              if( $sschild->getName()=="wind_condition")
                                {
                                    $wind_condition = $sschild['data'];
                                }
                          }
                         
                    }
                   
                }

         
         
          }
   
 }



?>