Skip to content

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…

PHP curl strange behavior PUT vs. POST

One of my projects contains an interface to a web based database, which I call using curl. A curl with -X PUT will create a new record, a curl with -X POST will update an existing record. If I perform this using Advanced REST Client, it works as it should. If I try this using a call of curl_exec out

PHP Group array by date

I have the following array that gathers data from purchases, visits and coupons generated in my application: array:10 [ 0 => array:2 [ “dt” => “2020-11-18” “cupoms” => 9 ] 1 => array:2 [ “dt” => “2020-11-19” “cupoms” => …

Get File from FTP server only for current date via FTP

I am trying to get a file from FTP with the last modified date as today. This works perfectly if I know the file name. In my FTP server, the file name is dynamic. I only know the file extension which .csv and has one CSV file with many other different files. how do I get only the .csv file