How to remove key from array in Laravel 5?By Hardik Savani | July 7, 2016 | | 12793 Viewer | Category : Laravel
Sometimes, we require to delete specific key from array like we have password and confirm-password field but we don't require to store confirm-password field we have to drop that key from input array, At that time we always use unset() function of PHP pre-define.
But if you work on laravel then you can array helper function. we can remove multiple key from variable using array_except() of Laravel pre-define function. In bellow example you can understand very well.
$myArray = ['name'=>'HD','email'=>'firstname.lastname@example.org','password'=>'123456','confirm-password'=>'123456'];
$myArray = array_except($myArray,['confirm-password']);
- Laravel 5 - like query example using eloquent where clause.
- Jquery notification popup box example using toastr JS plugin with demo
- How to change app version code in Ionic framework
- How to remove specific value from php array?
- Which MySQL datatype use for store an IP address?
- Laravel 5 - line chart example code using google charts API
- How to get current controller or method name in Codeigniter ?
- How to upload image with validation in PHP Codeigniter?