Skip to content

Tag: php

Sort files with filemtime

I have PHP file that generates gallery from a directory of images. I want to sort images by modification date. I’m trying to use filemtime function then sort function using the following code: And the output is like this: It is not sorted by modification date. How can I make my code work? Answer

Laravel 5.5 autodiscovery not registering

I’m installing the spatielaravel-backup package. According to the instructions, I just need to composer require spatielaravel-backup and the package should be recognized and auto-installed. It looks like this is happening: But looking in /config/app.php there’s no mention of backup anywhere in the…

PHP: send request post login web site

I have this POST request to login to a website: The post request header requires the following fields: From an analysis of the post request, you notice that by sending the first cookie obtained from the website “ASP.NET_SessionId=”, you immediately get an additional authentication cookie “SS…

Redux Framework switch type

how to use redux framework switch type in wordpress themes? or or or or or I worked with all of this and that works Properly but sometimes does not work. Answer You can follow this steps. Step-1: use this type of code to add switch, and focus on id value. Step-2: Use this code to use switch Try that ,

Without Regex: String Between Quotes?

I’m creating a word-replacement script. I’ve run into a roadblock with ignoring strings between quotes and haven’t been able to find a decent solution here that didn’t involve Regex. I have a working …

Upload image in Laravel

I try these code in controller: My Html input file: but i can’t upload. Any idea? Answer you can use storage::putFile(‘folder_name’, $request->image) this will return automatic generated filename and you can store that in your database. And make sure your have your default file system set…