Category "php"

PostfixAdmin Nginx configuration for accessing via subfolder

First of all, my Nginx configuration server { listen 1443 ssl http2; root /usr/share/webapps/postfixadmin/public/; index index.php;

Change post status to draft (on button click - front-end) with wp_update_post()

I'm adding a button via shortcode into my post on front-end. On click, this button should change the current post status to 'draft'. Changing to 'draft' seems t

image converted from pdf file with Imagick got grey background

I'm trying to convert a pdf file to image with imagick in php. The script works fine but the image created has a grey background like if the background of the p

PHP Fatal error: Cannot use ::class with dynamic class name

I uploaded a website to a live server with this code class Model extends Database { public $errors = array(); public function __construct() {

How do I convert from 5 digit number date in PHP? [duplicate]

I tried to import an Excel file in the database,but the dates are shown as 5 digit numbers 44605 representing 2/13/2022.What can I use to conv

If isset function variable paramenters php

I have this function private static function applayPrice($objProduct, Product $product, $applay_price, $applay_old_price) {} The problem is that someti

Getting unwanted 0 in the front of array

I am working with Ajax, as request is success but not getting proper json response. In Response its getting like this 0{.....} What is the solution to this? MY

i would like to send html content with css to email using php. this i got so far. all work but the content that was sen in email is not interpreted

this is the code where i send email. the file_get_contents(); i retrieve the content but in plain format text. the css style didnt read. <?php use PHPMaile

Your server might not be configured to send mail using this method

I want to verify email when users register. I am using codeigniter3. When I run on the localhost I do not receive any mail. I get this message " Unable to send

How to attach a string on php variable [duplicate]

I am trying to attach a string on php variable this is my code if ($tipy = "2"){ $username = "dr_" + $username; } and output to b

Can i combine Slim Framework with plain PHP

I just started with PHP not too long ago and have done some small projects with just plain PHP + Ajax + html. I’m more comfortable with procedural code th

Access php variables of a template with ajax

I know that this question has already been answered in other topics but for some reason it doesn't work for me and I don't understand why. I call a template wit

Get start date of event, format it and then display it with a shortcode

I have an [essential grid] grid which goes through some [the events calendar] events. Now in each of those items, I want to display the event start date but whe

Test multidimensional array with Laravel and Pest

I have a little problem when I want to test an array in my unit test. I want to test both structure and type of keys, but I don't know how to process it (I trie

PHP - Compare values ​in an array of objects

I have an array of objects and i should compare which ones have two equal values. The real case is this: i have a series of events, each of which has a date, a

PHP: Update database with checkbox values for each row

I'm currently working on displaying a table containing a list of alarms, where each row contains a checkbox that determines whether the user has already viewed

PHP - Resort Array with a Key array [duplicate]

Good day, So I have the following array to start with that has items added to it. The order the items are added in the list have no specific s

Using WPML wordpress with Multilingual laravel application as subfolder

I have a multilingual laravel application. My url structure like that: https://example.com/en/paths https://example.com/es/paths I installed wordpress in /publi

Convert .htaccess rewrite rule for showing a custom 404 to be php-fpm friendly

I'm reinstall server on Ubuntu 20.04 with control panel "Hestia" with php-fpm support. But i have 404 error in front page domain.com/ if i use in .htaccess: Rew

Fastest, most efficient way to check for changes in a large XML file (100k+ entries) updated daily with PHP

I am working with xml files with 50-150k+ entries, and about 50-100MB+ in size that change daily. All entries are unique, and have 10-15 elements per entry (id