Laravel - htmlspecialchars expects parameter 1 to be string object given

0 votes

I got this error:

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

I'm using in the controller:

$data = '{"pr":{"code":"1"},"ac":[[{"icon":"web","action":"link","url":"asd"}]]}'
$newData = json_decode($data);

And I send it to the view as an array: 'data' => $newData And when I try to use $data into the view, it gives me that error

Tried already to use $data->ac OR $data['ac'] but still the same... Some help, please?

Aug 10 in HTML by Deepak
• 940 points
287 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In HTML

0 votes
0 answers

How to get the entire document HTML as a string?

Is there a way in javascript to ...READ MORE

Jun 3 in HTML by Tejashwini
• 1,960 points
29 views
0 votes
0 answers

What's the right way to decode a string that has special HTML entities in it?

Let's say I submit a service request ...READ MORE

Jul 8 in HTML by Tejashwini
• 1,960 points
27 views
0 votes
0 answers

Which characters need to be escaped in HTML?

Are they the same as XML, perhaps ...READ MORE

Aug 19 in HTML by Tejashwini
• 540 points
14 views
0 votes
1 answer

How to Identify Web Element( Button) when there are multiple buttons without any ID

Hi Gangadhar, Do you need the HTML code to ...READ MORE

answered Feb 10, 2020 in HTML by Roshni
• 10,520 points
813 views
0 votes
0 answers

How to do calculation in PHP using a csv file for retrieving data?

Morning, I have a csv file and i ...READ MORE

Feb 11, 2020 in HTML by anonymous
• 140 points
921 views
0 votes
1 answer

How to align a <div> to the middle (horizontally/width) of the page?

Hello Kartik, position: absolute and then top:50% and left:50% places the top edge ...READ MORE

answered Apr 23, 2020 in HTML by Niroj
• 82,780 points
214 views
0 votes
1 answer

How to exclude specific folders every time I run 'eb deploy' using AWS EB CLI

If there is not .ebignore file it ...READ MORE

answered Oct 24, 2018 in AWS by Priyaj
• 58,080 points
1,370 views
0 votes
0 answers

Self Created Laravel Link Not Working

I installed laravel 6.0 through composer and ...READ MORE

Dec 3, 2019 in Others by anonymous
• 120 points
236 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,780 points
15,363 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP