Search
 
SCRIPT & CODE EXAMPLE
 

PHP

htmlspecialchars() expects parameter 1 to be string

<?php

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

htmlspecialchars() expects parameter 1 to be string, object given

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
Comment

PREVIOUS NEXT
Code Example
Php :: woocommerce add custom field data to cart page 
Php :: laravel avoid logged in user to access a page 
Php :: sentence get first second word php laravel 
Php :: woocommerce change "Billing Details" text 
Php :: laravel auth ui command 
Php :: remove all post in wordpress by query 
Php :: laravel print query with parameters 
Php :: how to find the name of login user in laravel 
Php :: include and require in php 
Php :: unset session in php 
Php :: case statement in php 
Php :: php install xdebug mac 
Php :: laravel firstorcreate 
Php :: WP_DEBUG enable 
Php :: php curl post 
Php :: migration with seeder laravel 
Php :: Merge Cell phpoffice phpexcel 
Php :: get theme path wordpress dev 
Php :: get woocommerce order details Object 
Php :: ubuntu set alternatives 
Php :: artisan mograte particular tabel 
Php :: convert to int php 
Php :: random string php 
Php :: mysqli php 7.4 
Php :: add foreign key column laravel 5.8 
Php :: sanitize_text_field 
Php :: increase memory laravel controller 
Php :: php get all values from associative array certain key 
Php :: php insert hyphen into spaces in string 
Php :: Class "AppUser" not found 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =