Category "php"

How create Nginx redirect if php send 404 error

i have a project and this project installed on few servers, he has one code, example: Server "A" => Project "A" Server "B" => Project "A" Project has bun

How create Nginx redirect if php send 404 error

i have a project and this project installed on few servers, he has one code, example: Server "A" => Project "A" Server "B" => Project "A" Project has bun

Use array_filter in foreach

I am presenting this problem when making a store in my database, which is data entered from a table in my view. Example: table For example, my user selects row

Use array_filter in foreach

I am presenting this problem when making a store in my database, which is data entered from a table in my view. Example: table For example, my user selects row

getting null values from the collection

I have an array that comes from an API request that has the stucture below. ^ array:40 [ "id" => 2 ... "categories" => array:2 [ "data" => ar

NginX: catch all file outside of root dir, with exceptions

I'm building a site running NginX / PHP and want all access to be processed by /private/routes.php. But I also want to add some exceptions to this for css/js-fi

Product varient size validation on Add to card in laravel

I'm using Laravel and I'm struggling a little bit with Add to cart button validation. The scenario is: if user want to Add to cart to cart is not added without

How to load Codeigniter 4 lang file into an array variable

Is there a way to load a file from Codeignier 4 Language directory and assign the array content to a variable. Instead of returning the translated line, I want

How To Access A Column In M-M Relationship Table In Laravel

I made a many-to-many relationship in laravel, where users can make announcements on an event. The problem is that I want to retrieve the announcement message f

Connection for controluser as defined in your configuration failed on ubuntu20.04 container

I'm trying to have one docker container with: ubuntu 20.04, on top of which I add apache, php, mysql and phpmyadmin (all on the same container) What's installed

How to fix this error : Ask your hosting provider to use PHP 7.2.5 or higher for both HTTP and CLI?

I am facing the issue while setup the Akaunting application. I cloned this repo from GITHUB source 1: https://github.com/akaunting/akaunting. I followed all the

curl lib in php needs html button click

I am trying to open a SAML xml endpoint with the following PHP code: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$URL); curl_setopt($ch, CURLOPT

Extract string between first whitespace and last whitespace in php

I have this string i want to extract string which is between first occurence of whitespace and last occurence of white space $string="...ence it is apparent why

Laravel 5.5 won't render email with PHP 7.4

I am trying to render an email in Laravel 5.5, but no matter what I do, I get the following error on render: ErrorException (E_NOTICE) Trying to access array o

How to get Woocommerce product variation id into a PHP variable for use with custom add to cart urls?

Using Woocommerce, I need to be able to add a variable product to the cart within a custom add to cart URL, such as with the following example, where 88 is the

Laravel 9: Custom login

I am trying to change the default table that laravel 9 uses to authenticate the users. But while I can see that user is authenticanted in the login function of

how to prevent float variables displaying as scientific notation when printing [duplicate]

I am using "(float)$val" for some calculation, but for some decimal value like -0.00000025478625 (float)-0.00000025478625 is resulting to -2.5

Laravel 8 Multiple Relationships for Factory

In Laravel 8 it is possible to quickly fill relationships with factories. However, I cannot figure out how to generate more than one relationship. How can I cre

Normalize DateInterval in PHP

The situation/issue I have an issue with DateInterval in PHP. Given the following code $interval = new DateInterval("PT6000S"); echo $interval->h; // 0 echo

How do you reconcile the path of a file inside mySQL with the domain name your browser puts in front of it, to view it?

I'm successfully uploading some files to a folder and saving the path in table. If I display the file's path in an html table, hovering over it, the address on