Category "php"

Laravel 5.1 how to use {{ old('') }} helper on blade file for radio inputs

I'm currently learning laravel and creating my first form. Everything is awesome until I want to use {{ old('') }} helper in my blade file for radio buttons. I'

PhpStorm and PSR-12, how can I add it as default coding style?

PSR-12 is an extension of PSR-2, and therefore also an extension of PSR-1. The basis of PSR-12 is PSR-2 and therefore a list of differences is provided b

Additional price based on cart item count in WooCommerce

Based on "woocommerce change price in checkout and cart page" answer code that change the total price in checkout page, I have added some extra code to count th

Convert string to lowercase AND then convert it to its original form in PHP, is it possible?

I need to convert input data to lower and then return it in it's original form with PHP, is it impossible or does anyone have a solution? thank you. ps, i'm

Note: Enabling the database statistics here might cause heavy traffic between the web server and the MySQL server

Note: Enabling the database statistics here might cause heavy traffic between the web server and the MySQL server. I got this error when I tried to add a

Group rows by column and sum another column within groups [duplicate]

I have an array looking like: array(480) { [0]=> array(2) { ["tag_id"]=> string(4) "6291" ["az"]=> int(5) } [

Woocommerce shipping address is empty

the option on the site "Default to customer billing address" is selected but the shipping address is still empty. I tried to fix it with code add_action( 'w

Clients authentication and user authentication with laravel

I am working on api, where I have the following models. Merchant -> hasMany -> Shops Shop -> hasMany -> Customers Each merchant will have api tok

Facebook PHP SDK - "Please close this tab to continue" error in iOS

I'm using the PHP SDK (v5.0) to log users into my site, using the basic code from Facebook's docs (I filled in and/or changed the necessary parts for my website

How to skip cart page on woocomerce for certain products only?

I added this to my functions.php file : add_filter ('woocommerce_add_to_cart_redirect', 'woo_redirect_to_checkout'); function woo_redirect_to_checkout() { $che

Filter WooCommerce products with post__in and additional meta queries

I am trying to find products that are on sale (including product variations) in addition to another meta_query of price under X. The wc_get_product_ids_on_sale(

Unable to match results of php hash_hmac() and coldfusion hmac()

I am working on encrypting a URL and converting a working script from PHP to ColdFusion. I have completed 95% of the work but I am stuck at this point after try

PhpSpreadSheet: How to save Workbook sheets in individual CSV files

I'm using PhpSpreadSheet and I need to save the sheets contained in a workbook as individual CSV files. I've tried to use $reader->setLoadAllSheets(); but

backup files to google drive using PHP

I have a server and a domain name on GoDaddy. I want to create a backup for my files to be uploaded on Google Drive So that all my files and my database have

Cut an arabic string

I have a string in the arabic language like: على احمد يوسف Now I need to cut this string an

PHP Java bridge exception - protocol error

I am running the PHP-Java bridge server (apache-tomcat). Sometimes I get an intermittent error. It's working when I restart the tomcat server from /opt/apache-t

Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: ) in Unknown on line 0

I have a local PHP7 & Apache environment on my Mac. All my scripts from one site are showing this error at the end of the page: Warning: Unknown: Failed

How to to send mail using gmail in Laravel?

I try again and again to test sending an email from localhost but I still cannot. I don't know anymore how to do it. I try search to find solution but I cannot

Laravel get user data with profile

I have user and profile models with followers/following. What I want is to get the User data with the Profile data merged when calling Profile::followers. Now I

Google API Heatmap Layer exception, why?

I want to pass the heatmapdata array for my Heatmap Layer from my PHP file. When running my code (below) I get the following exception: Uncaught TypeError: