Posts

show month name from month number value

$m=monthnumber(like 1 OR 2 OR 3 OR 4)); return $m % 13 ? date(M, $m * 25e5) : 'invalid month'; 

Algorithm that will check whether the given grid of numbers represents a valid Sudoku puzzle In PHP

Sudoku  is a number-placement puzzle. The objective is to fill a  9 × 9  grid with numbers in such a way that each column, each row, and each of the nine  3 × 3  sub-grids that compose the grid  all  contain  all  of the numbers from  1  to  9  one time. Implement an algorithm that will check whether the given  grid  of numbers represents a valid  Sudoku  puzzle according to the layout rules described above. Note that the puzzle represented by  grid  does not have to be solvable. <?php function sudoku2($grid) {    $n=count($grid);    $m=count($grid[0]);    if($n==$m)    {        $status=true;        foreach($grid as $key=>$gridDetail)        {         ...

Remove gitignored file from tracking

The series of commands below will remove all of the items from the Git Index (not from the working directory or local repo), and then updates the Git Index, while respecting git ignores. PS. Index = Cache First: git rm -r --cached . git add . Then: git commit -am "Remove ignored files"

checking coloumName value before update. if value of coloumName = 1 then 0,if coloumName = 0 then 1.

UPDATE `tableName ` SET ` couloumName `= IF (coloumName = 1 , 0 , 1 ) WHERE id = Idvalue

codeigniter 3.1.0 change log

Change Log Version 3.1.0 Release Date: July 26, 2016 Security Fixed an SQL injection in the ‘odbc’ database driver. Updated set_realpath() Path Helpr function to filter-out php:// wrapper inputs. Officially dropped any kind of support for PHP 5.2.x and anything under 5.3.7. General Changes Updated Image Manipulation Library to validate width and height configuration values. Updated Encryption Library to always prefer random_bytes() when it is available. Updated Session Library to log ‘debug’ messages when using fallbacks to session.save_path (php.ini) or ‘sess_use_database’, ‘sess_table_name’ settings. Added a ‘LONGTEXT’ to ‘STRING’ alias to Database Forge for the ‘cubrid’, ‘pdo/cubrid’ drivers. Added ‘TINYINT’, ‘MEDIUMINT’, ‘INT’ and ‘BIGINT’ aliases to ‘NUMBER’ to Database Forge for the ‘oci8’, ‘pdo/oci’ drivers. password_hash() compatibility function changes: Changed salt-generation logic to prefer random_bytes() when it is available. Changed salt-generation logic t...

Read Email messages using php

<?php class Email_reader { // imap server connection public $conn; // inbox storage and inbox message count private $inbox; private $msg_cnt; // email login credentials private $user   = 'usernam'; private $pass   = 'password'; // adjust according to server settings // connect to the server and get the inbox emails function __construct() { $this->connect(); $this->inbox(); } // close the server connection function close() { $this->inbox = array(); $this->msg_cnt = 0; imap_close($this->conn); } // open the server connection // the imap_open function parameters will need to be changed for the particular server // these are laid out to connect to a Dreamhost IMAP server function connect() { $this->conn = imap_open('{imap.gmail.com:993/imap/ssl/novalidate-cert}', $this->user, $this->pass); } // move the message to a new folder function move($msg_index, $folder='...

Enable the imap in support in xampp server

As default, the IMAP support for PHP is deactivated in XAMPP due to some mysterious initialization errors with some home versions like Windows 98. If you work with NT systems, you can open the file "\xampp\php\php.ini" to activate the php exstension by removing the beginning semicolon at the line ";extension=php_imap.dll". It should be: extension=php_imap.dll Now restart Apache and IMAP should work. You can use the same steps for every extension, which is not enabled in the default configuration.

get the thumbnail of the you tube url

function get_youtube_thumb($link,$type){     $video_id = explode("?v=", $link);          if (empty($video_id[1])){            $video_id = explode("/v/", $link);             $video_id = explode("&", $video_id[1]);             $video_id = $video_id[0];         }     $thumb_link = "";     if($type == 'default' || $type == 'hqdefault' || $type == 'mqdefault' || $type == 'sddefault' || $type == 'maxresdefault'){         $thumb_link = 'http://img.youtube.com/vi/'.$video_id.'/'.$type.'.jpg';     }elseif($type == "id"){         $thumb_link = $video_id;     }     return $thumb_link;  }

Code For Showing the path on google Map Using the html and java script

code for the showing the path on the google map

A NEW ERA OF ECOMMERCE INNOVATION Magento launch the version 2.0

Magento announced the general availability of there next generation open source digital commerce platform, Magento 2.0.  The new platform empowers brands, retailers, and businesses across B2C and B2B industries to quickly and cost-effectively deliver engaging omnichannel shopping experiences. Magento 2.0 also offers enhanced performance and scalability,  new features to boost conversion rates, and business agility and productivity improvements. The new platform also builds on our open source heritage and offers unmatched flexibility and innovation opportunities to our global ecosystem of partners and developers. Two new products based on this powerful platform are available for download today: Magento Enterprise Edition 2.0 and Magento Community Edition 2.0.