PHP code example of openlss / func-mda

1. Go to this page and download the library: Download openlss/func-mda library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

openlss / func-mda example snippets


$array = array('test'=>array('test2'=>array('test3'=>'value')));

//get a key
$val = mda_get($array,'test.test2.test3'); //returns 'value'

//set a key
mda_set($array,'test.test2.test3','newvalue');

//add a key
mda_add($array,'test.test2.test4','value3');

//get the added key
$val = mda_get($array,'test.test2.test4.0'); //return 'value3'


mda_set($arr,'index1','index2','index3.index4','value');

mda_add($arr,'index1.index2','value');
//is the same as
$arr['index1']['index2'][] = 'value';

$arr['index'][0] = 'value';
$arr['index'][1] = 'value';
mda_del_value($arr,'index','value');
$count = count($arr['index']); //returns 0

$array = array(1,2,3,4,5);
$join = array('/','.',',');
$str = implodei($join,$array); //returns 1/2.3,4,5