Category "php"

How to pass all user's data when clicking edit button?

I created a display page using php where all users records are displayed in a table and there are delete and edit buttons to manage users, for the delete option

PHPSpreadsheet setAutoSize function not working as expected

I am using PHPSpreadsheet and I'm doing the following to autosize the relevant columns: foreach (range('A', 'K') as $col) { $productsSheet->getColumnDime

Laravel migration: using a native PHP enum

In PHP 8.1, native support for enums were introduced. How can I use them in a Laravel Migration? My first thought would be something like this, but it does not

Display Data from MYSQL using PHP Dropdown

I need to display data from the 'Members' table based on the selected 'grad_date' from a drop down. I have been trying to do it for a while now but have struggl

How to use PHP natsort to sort out mysql records

I have been trying to sort out my mysql records with mysql queries but seems like its just impossible to do it in the natural order. I have values such as a1, a

Flutter http post request to a PHP file

I am using Flutter for mobile app development. I need to make a POST request to a PHP file in order to save data in my MySQL server. However, I check the reques

how i can capture a json value if have a lot of the same value

i get this json response [{"app_id":"com.mojang.minecraftpe","description":"Millions of crafters have smashed billions of blocks! Now you can join the fun!"

How to fix: PHP Startup: Unable to load dynamic library 'php_pdo_sqlsrv_80_nts_x64'?

I get this error while attempting to run a php command from cmd.exe on Windows 10 pro. Looking in the ext folder, I can see I have the dll. I also have this li

Wordpress | echo attribute_name and _value

I am using flatsome theme and i have a theme action hook called flatsome_product_box_after. Basically he is located after the product picture on my Shop Catalog

I have some problems with the Login (Laravel)

I'm doing an application and I need to do a Login. I already do it, and it was working until yesterday, but today it stops work and I don't know why. I was sear

Contact Form 7 - Conditionally/Dynamically Attach Local Files to Email Based on Input Selection

I have a number of checkboxes that indicate the item that is ordered through our online order form system. For each item selected there is a corresponding .pdf

Remove '.php' file extension but still validate paramaters after trailing slash?

I've been searching for how to do this, and I haven't been able to get anything to work yet. I want to remove the '.php' file extension from all files that have

Regex Error: A lookbehind assertion has to be fixed width [duplicate]

My pattern works in JavaScript. (?<=(?:username|Email|URL)(?:\s|:))[^\n]+ However, when I try to use it in PHP, I get this error: A lookb

Join columns of Day, Month , Year to calculate age

public function patients_view($id) { $patient = Patients::where('id', '=', $id)->first(); // .... } I just need to view the age. Thanks , im usin

How do I check all the redirects of a URL and get it as an array?

I'm making a site which checks all the URL redirects, just like wheregoes.com. This site doesn't provide any APIs. I have to get all redirects, then select the

ACF Pro - Field showing up in backend, but it's not saving (disappear on refresh)

I have a website with more than 15 ACF groups. On one of them, there's a repeater and the last of 6 fields is a URL (I tried switching it to Text, same result).

Replace substring till space is found after specified position in PHP

I have this main string $string = "This is a sample text"; $substring = substr_replace($string, "", 11 , 6); Output: This is a text I'm passing $string varia

Ajax not properly sending Session variables

I am very new to AJAX and PHP and am currently working on a small website where I initialize php objects as session variables. The functions and objects are all

Remove billing address (only show shipping address) in certain WooCommerce email notifications

The action 'woocommerce_email_customer_details' includes both the billing and shipping address data. I only need the shipping address. How can I achieve this? B

download file to my server with php with a url without file name

I can download a csv file via a fixed url. The url just doesn't have a file name. When I open the url in a browser, the file export.csv is generated and after a