Category "php"

Currently Using CodeIgniter Framework i have an Error

A PHP Error was encountered Severity: Notice Message: Undefined property: Login::$U_Model Filename: controllers/Login.php Line Number: 24

Find the "bad control character" that json_decode fails on in PHP?

I have a lot of JSON strings that are 25-50Kb each. I convert these to arrays with json_decode() and it works fine almost every time... But now I have ran into

Change the alert text on add to cart action without selected variation in Woocommerce

in Wordpress I'm using Woocommerce v3.3.5 and in single product pages for variable products, When I click the add to cart button while I don't select a variatio

What's the difference between `retry_after` and `timeout` options for Laravel queues?

I came across an issue in my code base where a job was being terminated early while its timeout was set to 540 seconds. However after looking in the documentati

Prevent blank space in pdf pages (DomPdf)

I don't want to leave blank spaces or leave only the minimum possible in pdf. I noticed that the tag is only inserted on the page when all its content fits on t

Check if user online laravel

I have column last_activity, where write date last activity user with middleware. How I can check online user and when he logout? Middleware: class LastActivi

Cannot retrieve order_id from database with SQL query

We are trying to update WC orders based on an external script. However, the script is unable to acquire the order_id for some reason. I tried to run the SQL que

sqlsrv_num_rows resule Warning: sqlsrv_num_rows() expects parameter 1 to be resource, boolean give [duplicate]

$results = sqlsrv_query($dbconn, $query2, array(), array('Scrollable' => 'static')); if (sqlsrv_num_rows($results) >= 2) { $query3 =

(PHPUnit) PHP Fatal error: Uncaught Error: Call to undefined function each()

firstly I was receiving a warning and a fatal error. The warning: Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue

Get WooCommerce product variation attribute terms in admin products general box

I display the id and sku of each variable product in the general tab - of the wp admin product data box with the following code. Any idea how to get the the var

Not able to access model in the controller mautic

Not able to access new model in the controller in mautic Mautic uses Symfony 2.x framework Steps taken: created entity extending CommonEntity created reposit

Composer Curl error 60: SSL certificate problem: unable to get local issuer certificate

I'm trying to get composer to work on a remote Windows-machine which is using a proxy, but I always get this error when doing a composer install/update: [Compo

WordPress - Dynamically add user ID to the end of a URL

I'm looking for a way to have the current logged in username added to the end of a link. example: www.mywebsite.com/custom-post-type/author-post-title "author-

Display Brand Name Above Product Title in Woocommerce Cart, Checkout Page, Orders and Email Notification

Using the functions below I've applied a custom field to products added in Woocommerce cart and checkout page also to orders and notification email. My questi

Fresh Laravel install deletes server.php on artisan serve

I'm a bit fresh to Laravel. I installed it via composer in the xampp/htdocs file. I installed the latest version 5.6. The install works with no errors, and the

Phalcon: setStatusCode returns empty response

I'm trying to write error handling for one of the endpoints in phalcon. If I set status code to client/server error code(4xx/5xx), then the response returned is

Two sessions and two different lifetime in Laravel

If change Laravel lifetime sessions in .env file it works for all sessions. How can I determine the lifetimes of every session separately?

Set quantity minimum, maximum and step at product level in Woocommerce

I'm using "set minimum and maximum allowable product quantities to be added in WooCommerce Cart" to require a minimum and maximum quantity order. Now, i need to

How to average columns of data from multiple, flat arrays?

Let's say I have 4 arrays with the same amount of values in each: $array1 = array(0, 7, 5, 0); $array2 = array(2, 6, 10, 0); $array3 = array(4, 8, 15, 10); $arr

is there any way to validate a field that sometime is File(image) && sometime is String(Src of same image)

my problem : i am using laravel framework php i want validate a field witch my field sometime is File(image) and sometime is String(src of same image) is there