Category "php"

Multi Tenancy SAAS Application in Codeigniter4 [duplicate]

I am trying to build a multi tenancy saas Application using Codeigniter4. I want to setup individual database for each tanent's data and one g

How can we do PGP encryption/decryption using RSA in Php?

I have installed GnuPG library and used below code for encryption and decryption: $public_key = '/path/0xC6235F66-pub.asc'; $private_key = '/path/0xC6235F66-se

Symfony + Laragon, debug toolbar not working

Symfony version: 5.4.8 Project works fine but debug toolbar is all time retrying to load... But if I start project with symfony serve and access localhost:8000

How do I delete images that are not used in the database?

I have written scripts that check images in a directory and in a database. I need to delete images in a directory that are not in the database. How can I do thi

Way to match *all* newline-type character sequences in a text file

I'm looking for a way to obtain all sequences of newline-like characters found in a string. I'm trying to use preg_match() as follows: preg_match('/^[^\r\n]*(?

"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP

I'm running a PHP script and continue to receive errors like: Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php on line 10 Notice: U

Divide/Split an array into two arrays one with even numbers and other with odd numbers

Please see my script, and identify the issue. Trying to Split an array into two arrays by value even or odd without built-in functions in PHP <?php $array =

php list files to array and save array stringified to disk [duplicate]

In my web app I want to list in php the contents of a directory "archives/*-pairings.txt" So I have a php file (below) that is supposed to rea

How to output sql date row to time elapsed

I have table with row id, name, created_at and I want to output the created_at row as timestamp time ago in php

problem to do a post at soap service from php soapclient

i'm a new using soap services, so i have a problem when i consume a soap service using soapclient in php. this is the request at soap: <x:Envelope xmlns:x="h

Upload a pdf file in core php

//=============== PDF File Upload===================== if (isset($_FILES["pdfile"])) { $filename = $_FILES['pdfile']['name']; $dir = "../pdfs/st

How do I use fetchAll in php?

I am using this statement to fetch the elements in a column in my db $result = $stmt->fetchAll(PDO::FETCH_COLUMN, 0); but I get this error when trying to

Create new productpage when new database entry

How can I create a new page when I enter a new product in my database, or hide the parameter inside a normal /.../ ? In this example I will sell Sandles with th

Consent is required to transfer ownership of a file to another user [Google Drive API]

I have a Google Sheets file shared with 1 user - owner (Gmail account) and 2nd user - writer (google service account like @iam.gserviceaccount.com). I use this

Number to Excel column name conversion

In Excel, column names are characters from A to Z, if there are more columns needed, it continues with AA, AB ... I want to write a function, that converts inte

Would like to write a javascript that helps me to find documents in a folder

I would like to write a js for an offline website (located on a local Windows server or any other server). It's supposed to look for files like PDFs in several

Warning: count(): Parameter must be an array or an object that implements Countable in Magento 2.4.3

protected function _saveAppliedTaxes( Address $address, $applied, $amount, $baseAmount, $rate ) { $previousl

php HeadlessChromium\BrowserFactory not found in file.php

<?php use HeadlessChromium\BrowserFactory; $browserFactory = new BrowserFactory(); ?> I've installed chrome-php/chrome with composer and hovering my mo

How to upload a video using ACF in WordPress?

I am still at learning phase in WordPress. I cannot figure out in ACF which field type should I choose to upload a video file and which code should I write to s

How to deal with mysqli problems? mysqli_fetch_array(): Argument #1 must be of type mysqli_result

In my local/development environment, the MySQLi query is performing OK. However, when I upload it on my web host environment, I get this error: Fatal error: Ca