Horje
php json_encode remove array index Code Example
how to remove array index from json in php
<?php

// numeric array keys with no gaps
$a = ['a', 'b', 'c'];
echo json_encode($a);
// ["a","b","c"]

// filter out the 'b' element to introduce a gap in the keys
$a = array_filter($a, function ($v) {
    return $v !== 'b';
});
echo json_encode($a);
// {"0":"a","2":"c"}

// re-index the array to remove gaps
$a = array_values($a);
echo json_encode($a);
// ["a","c"]
php json_encode remove array index
$arr['dates'] = array_values($arr['dates']);
//..
$arr = json_encode($arr);




Php

Related
symfony request post Code Example symfony request post Code Example
infyom Generate From Table Code Example infyom Generate From Table Code Example
attach a file to email php Code Example attach a file to email php Code Example
another query to get user details Code Example another query to get user details Code Example
$SERVER get cuurent directior PHP Code Example $SERVER get cuurent directior PHP Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7