Can I get somehow statistics from my discord server (like online users, all members) with PHP? How can I get a statistic like online users with PHP from my discord server?
Tag: php
PHP – read CSV from Google Sheets but sheets redirect to login
I have created several sheets in Google Sheets that I’m retrieving with a CSV output through PHP. It was all working fine until today while I have not changed anything to my code. I was using this: It was working fine. If I try to access my sheet directly through the browser I get a CSV file in return b…
Weird behavior PHP DateTime and DateTimeZone
PHP DateTime and DateTimeZone works incorrectly for me around DST change dates. I wrote a simple function to convert local time to UTC and I called it with the midnight time from the 24th of Oct to the 2nd of Nov with the timezones Europe/Paris and CET: The output: For Europe/Paris I got the changed DST inste…
Problem with PHP object and foreach loop, object not properly storing values
I’m trying to get values from a file called input.csv and add it to an object called $myItem. I’m using a foreach method to do so, as you can see. For some reason that is unclear to me, the values of the object are getting mixed up. When I initially set the value of $item_number using my setter me…
Json corrupt variable by addition of a character
I make an Ajax call to a server side php script. The php should return a json variable like this : {“erreur”:”Pas de diffusion possible avant le 20-11-2020″,”title”:”Diffusion”} And I got that : s{“erreur”:”Pas de diffusion possible avant le 20…
Get all profiles in lat/long + range (laravel – laravel-mysql-spatial)
I am trying to build a form in my laravel app to get all users’ profiles that are in or x km around one selected city from my cities table. I’m trying to use the laravel-mysql-spatial that makes use of the ST_DISTANCE_SPHERE mysql function but cant really wrap my brain around the eloquent stuff ne…
PHP Wrap ALL fields in quotes fputcsv()
I’m relatively new to PHP so please bear with me. my code currently looks like this: This works as expected, however, the client requires ALL fields to be wrapped in quotations, not just those containing spaces. I’ve seen a lot of solutions online but they all seem overly complicated or seem to su…
accounts.google.com redirected you too many times in Laravel Socialite
I am working on social login in Laravel. When passing parameter for identifying sign in and signup, it occurs error. “accounts.google.com redirected you too many times.” Without a parameter, it works well. These are my router. This is my controller. This is my view. Answer I just found a route iss…
Update Catalina to Big Sur apache error /private/etc/apache2/httpd.conf: Could not open configuration file /private/etc/apache2/other/+php-osx.conf [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 1 year ago. Improve this question I update my macOS from Catalina to Big Sur. After updating my apache is n…
Manipulate string to convert it to another string with different format
I have a string in the following form: The first letter is a sort of label, the value is associated with a label. I must manipulate and convert my string to the following: With a simple loop, I created an array $temp: Starting from here, I could eventually loop again to build my new string. Or maybe I could d…