如何在 Laravel 5.3 中解码 base64 [英] How to decode base64 in laravel 5.3

查看:91
本文介绍了如何在 Laravel 5.3 中解码 base64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为移动应用程序开发 API,我从移动端获取 base64 格式的图像并将其插入到我的 profile_image 列中数据库

在我的网页中,我想显示该图像,那么如何对其进行解码

<div class="card-image card-circular"><img src="{{ $driver->profile_image}} ">//我想在这里显示

<div class="card-stacked"><div class="card-content"><p><b>姓名:</b>{{ $driver->first_name }} {{ $driver->last_name }}</p><p><b>电话:</b>{{ $driver->phone_number }}</p><p><b>地址:</b>{{ $driver->addess_city_village }} {{ $driver->address_state }}</p>

谢谢

解决方案

试试这个.

{{ base64_decode($driver->profile_image) }}

这将使用 base 64 解码 profile_image,然后打印结果.

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>

thank you

解决方案

Try this one.

{{ base64_decode($driver->profile_image) }}

This will decode the profile_image using base 64 and then print the results.

这篇关于如何在 Laravel 5.3 中解码 base64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
PHP最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆