如何在Laravel 5.3中解码base64 [英] How to decode base64 in laravel 5.3
本文介绍了如何在Laravel 5.3中解码base64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在为移动应用程序开发API,从移动端开始,我以base64
格式获取图像并将其插入到database
i am working on an API for mobile application, from mobile end i'm getting the image in base64
format and inserting it in profile_image
column in my database
在我的网站上我想显示该图像,所以我该如何解码
in my web i want to display that image, so how do i decode it
<div class="card horizontal card-driver-details">
<div class="card-image card-circular">
<img src="{{ $driver->profile_image}} "> //i want to display here
</div>
<div class="card-stacked">
<div class="card-content">
<p><b>Name:</b>{{ $driver->first_name }} {{ $driver->last_name }}</p>
<p><b>Phone:</b>{{ $driver->phone_number }}</p>
<p><b>Address:</b>{{ $driver->addess_city_village }} {{ $driver->address_state }}</p>
</div>
</div>
</div>
谢谢
推荐答案
尝试一下.
{{ base64_decode($driver->profile_image) }}
这将使用base 64解码profile_image
,然后打印结果.
This will decode the profile_image
using base 64 and then print the results.
这篇关于如何在Laravel 5.3中解码base64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文