1
votes

Synopsis:

After copying a fully working Laravel Web App (Laravel 5.8, PHP 7.2) from my Linux web server to a local Windows XAMPP installation (same PHP version), I'm always getting

"htmlspecialchars() expects parameter 1 to be string, array given"

inside the unmodified standard Laravel register controller/view.

The whole Laravel folder was copied unmodified, the PHP 7.2 inside XAMPP runs with standard configuration (fresh install).

Any idea what could cause that to happen under Windows only?

Full Laravel error message:

"htmlspecialchars() expects parameter 1 to be string, array given (View: C:\xampp-7.2\htdocs\mywebapp\resources\views\auth\register.blade.php)"

1
may be XAMPP has different interpreter of php - Guga Nemsitsveridze
show your code plz where you have used htmlspecialchars() - Amanjot Kaur

1 Answers

0
votes

So maybe this is the first time, and there is no previous old value

You can supply a default value, or you can insert the data from the user's existing record perhaps for example:

@if(in_array($education->translation_of,old('education',[])))

here, specified empty array as the fallback.