PHP – Communicate with an API

PHP cURL In general, we use cURL to communicate with API endpoints. Using cURL might not be the most pretty approach, but it definitely does the job. See the example below: // Method: POST, PUT, GET etc // Data: array(“param” => “value”)...

WordPress – Add a shortcode

Adding shortcode in WordPress is very simple. You can do it from functions.php of your child theme: // function that runs when shortcode is called function wpb_demo_shortcode() { // Things that you want to do. $message = ‘Hello world!’; // Output needs to...

Test PHP

If you need to test PHP between different PHP version try this online sandbox:https://sandbox.onlinephpfunctions.com/ 1 How to not get an “apple” element from the array $a = array(“a” => “apple”, “b” =>...

SOLID, DRY, KISS, YANGI

Quick preview – Develop PHP with standards. Fallow this rules to ensure your code is legit and well formed. Keep up with those principle and you will become a better programer. KISS – “Keep It Simple, Stupid” The simpler your code is, the...