Laravel:回显动态嵌套数组不起作用

时间:2019-02-13 02:12:13

标签: php arrays laravel loops exif

现在我正在尝试回显一个数组,该数组中可能(可能)有多个嵌套的数组。我知道这可能是一个经常被问到的问题,但不幸的是,到目前为止我没有读过的答案对我有用:(

我的数组如下:

(
[FileName] => test.jpg
[FileDateTime] => 1550019186
[FileSize] => 78111
[FileType] => 2
[MimeType] => image/jpeg
[SectionsFound] => ANY_TAG, IFD0, EXIF, APP12, WINXP
[COMPUTED] => Array
    (
        [html] => width="876" height="815"
        [Height] => 815
        [Width] => 876
        [IsColor] => 1
        [ByteOrderMotorola] => 1
        [Copyright] => Test
    )

[ImageDescription] => Bild der Studie
[Artist] => Test
[Copyright] => Test
[Exif_IFD_Pointer] => 2210
[Title] => ???????????????
[Comments] => ???????
[Author] => ???
[Keywords] => ??????????????????
[Subject] => ???????
[UndefinedTag:0xEA1C] => �
[DateTimeOriginal] => 2019:02:13 21:03:07
[DateTimeDigitized] => 2019:02:13 21:03:07
[SubSecTimeOriginal] => 79
[SubSecTimeDigitized] => 79
[Company] => Ducky
[Info] => 
)

我尝试了几个代码段like this,但似乎都没有用。

我的Laravel代码如下:

<tr>
    <td>Exif Data</td>
    <td>
        <pre>
            @foreach($exifValues as $values)
                {{ print_r($values) }}
                @if(is_array($values))
                    @foreach($values as $value)
                        {{ print_r($value) }}
                    @endforeach
                @endif
            @endforeach
        </pre>
    </td>
</tr>

该表应如下所示:

<table id="exif-table" class="table">
    <thead>
        <tr>
            <th scope="col">Name</th>
            <th scope="col">Wert</th>
            <th scope="col">Bearbeiten</th>
        </tr>
        <tr>
            <td>NAME</td>
            <td>VALUE</td>
            <td>(other Stuff)</td>
        </tr>
    </thead>
</table>

或者使用我上面发布的数组中的实际值:

<table id="exif-table" class="table">
    <thead>
        <tr>
            <th scope="col">Name</th>
            <th scope="col">Wert</th>
            <th scope="col">Bearbeiten</th>
        </tr>
        <tr>
            <td>FileName</td>
            <td>test.jpg</td>
            <td>(other Stuff)</td>
        </tr>
        <tr>
            <td>FileDateTime</td>
            <td>1550019186</td>
            <td>(other Stuff)</td>
        </tr>
        <tr>
            <td>FileSize</td>
            <td>78111</td>
            <td>(other Stuff)</td>
        </tr>
        <tr>
            <td>FileType</td>
            <td>2</td>
            <td>(other Stuff)</td>
        </tr>
    </thead>
</table>

希望这会有所帮助。

0 个答案:

没有答案