Monday, May 20, 2013

How to convert two dimensional array to one dimensional array in php

You can easily convert your two dimentional array into one dimentional array using following code

Two Dimentional array example :

Array
(
    [0] => Array
        (
            [0] => 70
        )

    [1] => Array
        (
            [0] => 67
        )

    [2] => Array
        (
            [0] => 75
            [1] => 73
            [2] => 68
        )

    [3] => Array
        (
            [0] => 68
        )

    [4] => Array
        (
            [0] => 76
        )

)
 
Please use this function 
 
$oneDimensionalArray = array_map('current', $twoDimensionalArray); 

now you will get one dimentional array like below

Array
(
[0] => 70
[1] => 67
[2] => 75
[3] => 73
[4] => 68
[5] => 68
[6] => 76
)
 
Enjoy ....  

Thursday, May 16, 2013

Tortoise HG (Mercurial) – how to ignore entire folders



In my OS is  Windows 07 and I have used Tortoise HG .
How to I ignored the entire Folders.

  >> cd  path /your/repo

then you will create a .hgignore file in your repository.please use below commands.

       >> notepad  .hgignore

open the notepad and save this file.Please make sure this file save your repository folder.
Then Put the following lines.
Suppose you have used many folders.you need to ignore the two folders only.
    1)     assets/images
    2)    assets/css/images

Please put the below code to  .hgignore file.

Code:
syntax:glob

assets/images/*

assets/css/images/*

Screenshot :