Skip to content
Advertisement

Assign filename dynamically in a response

in my web application created with Laravel 8, I need to download an .xml file and the file name must be dynamically created, as per the title. this is because the file name is composed following a specific rule and having to include today’s date. $filename = ‘FirstPart_’.date(“Y-m-d”).’_000.xml’ so far to test the response and therefore the download I have

How to display fractional part of a decimal in tens in French

I want to display a decimal in words in French. I succeeded doing that using the NumberFormatter class. Here’s my code The output was vingt virgule un sept instead of vingt virgule dix-sept Please how can I fix this? Thanks Answer vingt virgule un sept is correct though. It’s just another way to say it. “twenty point one seven” vs

mysql query in procedural php isn’t returning single field

Trying to retrieve a single field from a mysql table. Here’s the PHP: I then use ajax to retrieve $sigDAT Ajax returns the following result for $sigDAT: [object Object] Ajax returns $signatureDAT (the original data) correctly. $sigDAT and $signatureDAT should have identical value, so I suspect the problem is in the “RETRIEVE” section of code. Answer To answer your question,

Xampp port 80 is use

Port 80 in use by “”C:Apache24binhttpd.exe” -k runservice” with PID 30352! Apache WILL NOT start without the configured ports free! You need to uninstall/disable/reconfigure the blocking application or reconfigure Apache and the Control Panel to listen on a different port Edit : I’ve tried all solutions I found in StackOverflow but it doesn’t work!! Answer On the control panel, change

How can I get the average star ratings? PHP Codeigniter

I am creating a rating system where the customer can rate the seller. I am using the rateyo plugin, so there’s a float value on it like 2.9, 3.8, 4.5, etc I would like to get all the values of the seller and get the average from it to display his/her overall total ratings. I am using Codeigniter as a

Sort Array from object

I have an object and store it in an array. However, when outputting the names from the object, I want to sort them by ‘is_main’. Thereby ‘is_main’ with the value 1 should always be in the first place and then ‘is_main’ with the value 0. Here is the Object And my PHP Code: I hope that someone can help me

Get collection values without loop in Laravel

I have hotels and services tables with many to many relationship. I want to get services of specific hotel without using foreach or forelse loop from one line of code. This is how I tried to do that: Result I get: Result is an array of values, I want it to be without brackets and quotes. Any suggestions? Answer Solution:

Advertisement