Category "php"

Trying to iterate over a mongodb cursor twice - failing

I am executing a query against my mongodb database... and then in two separate spots in my front end logic, I need to iterate through the results to extract / s

SendGrid: Sending an email to multiple recipients without other emails being shown on the "to" field

I want to send an email to multiple recipients. I used personalizations, but everyone's emails appears on the "to" field, which violates their privacy. I d

Hide email address with stars (*)

I have this mail address [email protected]. How to convert it into this mail address a****[email protected] I tried using strpos and get @ but I cannot get middle

Is there a simple way to stream a non-public IP camera into a website?

I'm trying to embed a non-public rtsp camera into a website without third-party software or plugins and capable for all browsers and devices. I found a workarou

Is there a simple way to stream a non-public IP camera into a website?

I'm trying to embed a non-public rtsp camera into a website without third-party software or plugins and capable for all browsers and devices. I found a workarou

passwordless LDAP login and get user information using Kerberos ticket in PHP

I'm trying to implement SSO on some intranet sites in our company using FreeIPA/Kerberos. But information on this topic is very thin. I have three machines runn

PHP - Write console output to file AND to console?

I want to write the console output to a file AND to the console itself. To write the console output to a file I'm using this: ob_start(); ... ... $output = ob

Add custom text under order details on WooCommerce My account view order pages

I need to add some custom text under the Order Details section of the WooCommerce view-order page. My goal here is to add some additional instructions: To

Issue saving card for customer

I would like to store credit card information for a customer in our QuickBooks account using the PHP Payments SDK - the following is what I am trying to achieve

WooCommerce Subscriptions: Remove role on cancelled subscription

I am using a third-party plugin to assign a role to a user when they purchase a subscription - there are two different roles depending on purchase (silver, gold

Function get_plugins() cannot be execute

I'm trying to code simple php script which will return all plugins of Wordpress. My code: <?php ini_set('display_errors', 'On'); include('../../../wp-ad

Transpose and flatten multiple rows of array data [duplicate]

Is there a native PHP function to zip merge two arrays? Look at the following example: $a = array("a","b","c"); $b = array("d","e","f"); $c

SMTP ERROR: MAIL FROM command failed: 530 5.7.0 Must issue a STARTTLS command first when using PHPMailer

I'm trying to get send an Email from my gmail account with PHPMailer. But when running the php-script on my localhost I get the following error: SERVER -> CL

Google Ads DeveloperToken

I want to update our code for the new Google Ads API but I cant find the API Center in Google Ads Dashboard with the main account. When I open the url to API Ce

Must be of the type array, null given,

I keep getting the following error and I'm not to sure why: Catchable fatal error: Argument 3 passed to System\Loader::action() must be of the type array, nul

Can't remotely connect to MySQL error (13) with PHP script, connecting through CLI works

I have looked at around 50 of the same question on here, but none of them seem to be fixing my problem. I can't remotely connect to my MySQL database through a

wordpress function breaks wp-admin

I've created a function in my custom WooCommerce site. This works great on the frontend, but wp-admin breaks. Wp-admin shows a http-500 error. This is the funct

How to display old value in dropdown on edit form then keep the selected value when the form submit failed?

The dropdown's option values were shown from a table on the database. When I clicked "Edit Form," the old values were successfully shown. For example, the optio

Bulk import products into Woocommerce using WP WC CLI

I'm trying to add 1000's of products into my woocommerce store using wp wc cli via my datasource which will give me the data in the following JSON format: {

How can I format this number correctly using PHP?

I have a number with numbers after the decimal but for some reason when formatting it, the last two decimals are always zero. For example a price is 154,95 as