How to convert an array to string in Laravel 7 | Without using implode or any other method in Laravel
![Conversion of array to string in Laravel 7 | Array to string conversion in blade file in Laravel Conversion of array to string in Laravel 7 | Array to string conversion in blade file in Laravel](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2E_5zS6EWTL3HYp6F3cW90H8JQSi6OuKaXQTZPNkxFoyHuP6Q4pG8O2S92eVC6IWvKRpJ2X9iNaEr5IwT-eB5EtOH2_IwLZCKjHYQV7dh5FjK6jP_bY7YUHk4bN0KG6fyKj9SdNbVuYk/s640/Vintage+Logotype+Etsy+Banner+%25282%2529.png)
In this article we are going to see conversion of an array to string in laravel blade file without using any built-in methods .we will use php code inside our blade file for conversion . lets see the code ...
result.blade.php ( source code )
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | <!DOCTYPE html> <html> <head> <title>Array to string conversion</title> <style> .main { font-size: 20px; text-align: center; } </style> </head> <body> <center> <h1> LARAVEL ARRAY TO STRING CONVERSION </h1> </center> <div class="main"> <?php $arr=array("this","is","an","array"); echo "array elements are"."<br>"; foreach($arr as $value) echo $value."<br>"; echo "The string is "."<br>"; ?> @foreach($arr as $value) {!! $value !!} @endforeach </div> </body> </html> |
output :
So this is just a short article for conerting an array to string in laravel..
Thank you for reading this article .
Hope it helped you -:)