Removing duplicates from the flatten array is simple and we have a built-in function for it. The array_unique function removes duplicates from the one-dimensional array. we gonna use array_unique function along with array_map, serialize and unserialize to remove duplicates from the multidimensional PHP array. array_map — Applies the callback to the elements of the given array serialized — Generates a storable representation of a value unserialize — Creates a PHP value from a stored representation
Leave a CommentMonth: September 2021
By calling the get_avatar() method we can get the author’s avatar, below is the code snippet to display the author’s avatar on posts or pages…
Leave a CommentLaravel eloquent has many events such as retrieved, creating, created, updating, updated, saving, saved, deleting, deleted, restoring, restored and each event will be triggered at a particular moment in the model lifecycle. retrieved This event will dispatch…
Leave a CommentIf you try to copy a file or directory or something from your running container to your Windows 10 host machine you may get the…
2 CommentsIn this tutorial, you will learn how easy it is to get data between two dates from the database using Laravel’s whereBetween method. Let’s say…
Leave a CommentDownloading images and files from the URL is simple and easy with Laravel’s Illuminate\Support\Facades\Storage; class. We gonna use file_get_contents function to reads the entire file into…
Leave a CommentIn this tutorial, you will learn how to write text to the existing pdf file in your Laravel application. We gonna write a simple PHP…
2 CommentsIn this tutorial, you will learn how to merge multiple pdf files in your Laravel application. We gonna write a simple PHP script to merge…
2 Comments