How to convert an array to string in Laravel 7 | Without using implode or any other method in Laravel
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 -:)