Category "php"

PHP array slice from position + attempt to return fixed number of items

I'm looking for an efficient function to achieve the following. Let's say we have an array: $a = [0, 1, 2, 3, 4, 5, 6, 7]; Slicing from a position should alw

PHP Startup: Can't load module 'ext\php_sqlsrv_81_ts.dll' - xampp

I have problem with connectting my laravel project to SQL server database. I'am using xampp with PHP Version 8.1.1. I downloaded appropriate extensions for my p

Update Order custom Field value with WooCommerce REST API

I am trying to update the Order custom field value lworder. I used the below code but I did not find any update. Can anyone please help me with this? $api_respo

Show date difference as "20" instead of "20 years ago"

{{Carbon::parse($etudiant->date_naissance)->diffForHumans()}} It appears like "20 years ago". But I want the age to appear only "20"

stay with the last 15 elements of an array [duplicate]

I have a database on couchdb, each document has a slightly complex structure, here is a small part: "category": { "1496805145": -1,

oci_connect() ORA-12170: TNS:Connect timeout occurred

I need to connect to remote oracle database using oci_connect(). After waiting for several minutes I get this error. $db = '(DESCRIPTION = (ADDRESS = (PR

Separate PHP script in a cron job

I have about 10 accounts. Also, I have a cron job with php script which executes every minute. This script is working for each client one by one. The problem is

PHPSpreadsheet - How Do I Use Auto Migration Tool

I'm a long time reader, but new to asking questions. Please correct me if I have somehow asked incorrectly. Intro We are upgrading our servers from PHP 5.4 to

Add a custom text for a particular product on specific email notification in Woocommerce

I want to add an extra text "There is an offer in this particular item etc" only for a particular product(Product Id:1) in customer-completed-order.php in WordP

Get sql.h error on MacOS 12 (Monterey) sqsrv and pdo_sqsrv drive installation

I have macOS 12 Monterey, PHP 7.4. I would like to install sqlsrv and pdo_sqlsrv drives. However, I got the following error. g++ -I/opt/homebrew/Cellar/[email protected]/

Magento 2 - Controller returning blank page

Been spending the last 1 day to find a fix for this. Basically everything works normal if I delete all the contents of generated folder and then generate the f

how to check version of codeigniter framework?

I recently setup a old Codeigniter framework on my xampp.But i don't know the version of this framework. I use the code <?php echo CI_VERSION; ?> bu

PHP AWS Cognito 'Error executing "SignUp" : ResourceNotFoundException : User pool client XXXX does not exist

When i implement AWS Cognito in my project Occur following error. Uncaught exception 'Aws\CognitoIdentityProvider\Exception\CognitoIdentityProviderException' w

Array divided into days of the week

I want the array to be divided into days of the week according to the date specified in BETWEEN and AND public static function showDataByEmployer($employer) {

Statement that checks whether a URL contains a particular path?

Is there an if statement that allows me to check whether a URL contains a particular path? In my particular case (using wordpress), I'm trying to check wether

PHP Print to Network Printer

What I'm trying to do Print a PDF document on a network printer while passing printing parameters for things such as colour, orientation, duplex, etc. More info

Call to undefined function ssh2_connect() in php 8.1.1

Does anyone know where to find php_ssh2.dll download for php 8.1.1 or php 8.0.14 PECL downloads are not compatible

Reorder attribute dropdown terms in Woocommerce single variable products

In the Woocommerce single variable product pages, I would like to change the order of the sizing options on the related drop-down menu. Actually It is like thi

How to set Google Play `inAppUpdatePriority` using google-php-api-client

I found following thread at : https://issuetracker.google.com/issues/133299031#comment14 Hello, In-app update priority of the release can be set using the P

TesseractOCR not working for Laravel

Hi I tried to read image content from laravel using TesseractOCR. This is my controller, <?php namespace App\Http\Controllers; use TesseractOCR; cla