Getting Started with Ansible

Getting Started with Ansible What is Ansible? Ansible is Simple IT automation tools that managing your server infrastructure, Including Code Deploys, Handling services on your remote server, Installations and configurations server. Here are some more key properties of Ansible: Ansible Installation: Getting started with ansible , installations steps for CentOS. You can find more details…

Read More
Count matching occurrences in php array

Count matching occurrences in php array

You can Count matching occurrences in php array using php array function array_count_values() Syntax: array array_count_values ( array $array ) array_count_values() returns an array using the values of array as keys and their frequency in array as values.  Example:-   <?php       $array = array(1,”roopendra”,1,”php”,”roopendra”);       print_r(array_count_values($array));   ?> Above code will output:

Read More
validate url in php

Validate URL in PHP

You can validate URL in PHP using regular expression or using validate filters Validate URL in PHP using regular expression: Example:- Validate URL using validate filters: Example:- Validate URL using validate filters with flag value: Flags:- FILTER_FLAG_PATH_REQUIRED  : Requires URL to have a path in URL the domain name (like www.example.com/Orders/order/) FILTER_FLAG_QUERY_REQUIRED : Requires URL…

Read More
Post JSON data via PHP cURL

Post JSON data via PHP cURL

Post JSON data via PHP cURL We can Post JSON data via PHP curl by using header Content-Type: application/json in CURLOPT_HTTPHEADER. Below is working code demonstration of PHP curl with post json field. <?php $url = ‘http://yourdomain.com’; $jsonString = json_encode(array(“key” => “value”)); // You can directly replace your JSON string with $jsonString variable. $ch = curl_init();…

Read More
Verified by MonsterInsights