“htmlSpecialChars () s'attend à ce que le paramètre 1 soit une chaîne” Réponses codées

htmlSpecialChars () s'attend à ce que le paramètre 1 soit une chaîne

<?php

$data = htmlspecialchars($data);
echo $data;
Azanda

htmlSpecialChars () s'attend à ce que le paramètre 1 soit une chaîne, objet donné

When you use a blade echo {{ $data }} it will automatically escape the output. It can only escape strings. In your data $data->ac is an array and $data is an object, neither of which can be echoed as is. You need to be more specific of how the data should be outputted. What exactly that looks like entirely depends on what you're trying to accomplish. For example to display the link you would need to do {{ $data->ac[0][0]['url'] }} (not sure why you have two nested arrays but I'm just following your data structure).

@foreach($data->ac['0'] as $link)
    <a href="{{ $link['url'] }}">This is a link</a>
@endforeach
Shadow

Réponses similaires à “htmlSpecialChars () s'attend à ce que le paramètre 1 soit une chaîne”

Questions similaires à “htmlSpecialChars () s'attend à ce que le paramètre 1 soit une chaîne”

Plus de réponses similaires à “htmlSpecialChars () s'attend à ce que le paramètre 1 soit une chaîne” dans PHP

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code