File tree Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Original file line number Diff line number Diff line change @@ -618,6 +618,70 @@ Arrays::emptyToNull($array, true);
618
618
*/
619
619
```
620
620
621
+ ** REMOVE EMPTY data to array**
622
+
623
+ Data:
624
+ ``` php
625
+ $array = [
626
+ 0 => ' first 1 ',
627
+ 'key1' => false,
628
+ 1 => '',
629
+ 2 => '0',
630
+ 'key4' => null,
631
+ 3 => [
632
+ 0 => ' first 3',
633
+ 1 => false,
634
+ 'key2' => '',
635
+ 2 => '0',
636
+ 'key5' => null,
637
+ 'key6' => 12,
638
+ 3 => [],
639
+ 4 => 'first 4 '
640
+ ],
641
+ 4 => true,
642
+ 5 => [],
643
+ 'key8' => 'first 2 '
644
+ ];
645
+ ```
646
+
647
+ Example:
648
+ ``` php
649
+ Arrays::removeEmpty($array);
650
+ /**
651
+ * [
652
+ * 0 => ' first 1 ',
653
+ * 3 => [
654
+ * 0 => ' first 3',
655
+ * 1 => false,
656
+ * 'key2' => '',
657
+ * 2 => '0',
658
+ * 'key5' => null,
659
+ * 'key6' => 12,
660
+ * 3 => [],
661
+ * 4 => 'first 4 '
662
+ * ],
663
+ * 4 => true,
664
+ * 'key8' => 'first 2 '
665
+ * ]
666
+ */
667
+
668
+ Recursive:
669
+ ```php
670
+ Arrays::removeEmpty($array, true);
671
+ /**
672
+ * [
673
+ * 0 => ' first 1 ',
674
+ * 3 => [
675
+ * 0 => ' first 3',
676
+ * 'key6' => 12,
677
+ * 4 => 'first 4 '
678
+ * ],
679
+ * 4 => true,
680
+ * 'key8' => 'first 2 '
681
+ * ]
682
+ */
683
+ ```
684
+
621
685
622
686
## License
623
687
You can’t perform that action at this time.
0 commit comments