My First Post

http://www.catswhocode.com/blog/useful-php-code-snippets-and-functions

 

http://webdeveloperplus.com/php/21-really-useful-handy-php-code-snippets/

 

15 very useful PHP code snippets for PHP developers

 

https://github.com/pH-7/Useful-PHP-Functions/blob/master/misc.fns.php

 

 

4 thoughts on “My First Post

  1. set global net_buffer_length=1000000000;
    set global max_allowed_packet=1000000000;

    C:\xampp\mysql\bin\mysql -u {username} -p {databasename} < file_name.sql

  2. Some Usefull Function in PHP
    1) array_rand
    2) strftime
    strip_tags
    basename
    list
    range
    explode
    implode
    preg_replace
    shuffle
    array_key_exists
    function_exists()

  3. function group_nums($array) {
    $ret = array();
    $temp = array();
    foreach($array as $val) {
    if(next($array) == ($val + 1))
    $temp[] = $val;
    else
    if(count($temp) > 0) {
    $temp[] = $val;
    $ret[] = $temp[0].’:’.end($temp);
    $temp = array();
    }
    else
    $ret[] = $val;
    }
    return $ret;
    }

    $nums = array(1, 2, 3, 4, 14, 21, 23, 28, 29);
    print_r(group_nums($nums));

Leave a Reply

Your email address will not be published. Required fields are marked *