I’m working on a PHP script that creates a .csv file from some data. Unfortunately, in Excel Umlauts are not displayed properly: Löl becomes L√∂l (this is just in Excel, in Apple’s Numbers, Atom and Textedit everything looks fine). I have tried hundreds of functions to try and get the encoding rig…
Authentication for HTTP Basic with a field different from password
On a Symfony 5 project, I have a User entity with both fields “password” (hashed) and “smsCode” (plain). When creating an account, the smsCode is used for authentication at first, …
Dates not casting after upgrading to Laravel 7
I have just upgraded from Laravel 6 (PHP 7.4) to Laravel 7 (PHP 7.4) and casting dates in a model has completely stopped working. For example, in my User model, I have the following $dates array: …
Convert Javascript encryption logic to PHP (Probably AES Method)
I’m having issue to convert following javascript encryption logic to PHP, this javascript library cannot be found on internet so there is no documentation or clue where to start. It seem the …
PHP MySQL – get comment count for all posts written by one user
My aim is to get a total count of ‘pending’ and ‘approved’ comments for all posts for a specific user. The comments table has a status column for ‘pending’ or ‘approved’. For the record, the page_id in the comments table maps to the id in the posts table. I star…
browse under folders and files of a folder on laravel
Hi all i am on laravel 7. I want to navigate through the folders and see their contents (subfolders and documents). To do this I used the following $directories = Storage::directories($path); …
Laravel Redirecting to a route is not working?
I am new to Laravel, when I am using redirect()->route(‘route_name’) after saving data, it does not work. Here is my controller function: Here are my routes : Any help will be appreciated. Answer You need to add the return keyword
php switch statement with wildcard in the string
I would like to have a switch statement with both literal cases and cases with a wildcard in the string: Of course the * will be taken literally here cause I define it as a string, so this does not work, but you know what I would like to accomplish: for the A, B and D cases the numbers can
how to stop adding more data in array in foreach loop
i looping 2 array a date and the data i am expecting this result What actually getting Adding old $r to results array How to fix it i am trying to break it but can’t figure it out Answer I have some untested code, as I do not have your data but I think this code below should work, you
How to set TWO first words of a slider header with a different color using variables in php?
There is a template https://wordpress.org/themes/bizberg/. In “Customize” the slider title type is adjustable, and the title’s first word color could be replaced with a theme color. BUT there’s no sense to set a different color on an article “the” in sentence “The world is beauti…