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, 2022 in HTML by Deepak
• 980 points
3,743 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, 2022 in HTML by Tejashwini
• 3,820 points
481 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, 2022 in HTML by Tejashwini
• 3,820 points
517 views
0 votes
0 answers

Which characters need to be escaped in HTML?

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

Aug 19, 2022 in HTML by Tejashwini
• 780 points
743 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,480 points
1,543 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
1,464 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,840 points
803 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,020 points
2,133 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
834 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,840 points
23,081 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP