Useful Command List in Magento 2:
Below, you’ll find the list of all important Magento 2 SSH / CLI commands that you’ll often need when working on a project. Create an admin user using the CLI: php bin/magento admin:user:create –admin-user=’admin’ –admin-password=’admin123′ –admin-email=’admin@mysite.com’ –admin-firstname=’Json’ –admin-lastname=’Bourne’ Unlock admin user account using the CLI: php bin/magento admin:user:unlock username Setup upgrades using the CLI: php … Continue reading
Custom posts type looping with custom taxonomies in WordPress
Loop any terms assigned to the custom post type along with custom taxonomy and display on the page
how to remove h2 formatting option from the wordpress classic editor
Below is the code to remove h2 option from wordpress classic editor
Password Strength Using Regular Expression IN PHP
<?php function password(){ $password = ‘user-pass’; //Password must be at least 8 characters in length. //Password must at least one upper case letter. //Password must at least one number. //Password must at least one special character. $uppercase = preg_match(‘@[A-Z]@’, $password); $lowercase = preg_match(‘@[a-z]@’, $password); $number = preg_match(‘@[0-9]@’, $password); $specialChars = preg_match(‘@[^w]@’, $password); if(!$uppercase || !$lowercase … Continue reading
AngularJS HTTP post to PHP and undefined output
Angularjs .post() defaults the Content-type header to application/json. This will overide form-encoded data, however it will not change data value to pass an appropriate query string, so PHP is not populating $_POST as you expect. Solution is use the default angularjs setting of application/json as header, read the raw input in PHP, and then deserialize the JSON. That can be achieved in … Continue reading
Converting stdClass object to PHP array
#Converting stdClass object to PHP array The easiest way is to JSON-encode your object and then decode it back to an array: $array = json_decode(json_encode($stdclassobject), True); Or you can also traverse the object using loop, too: foreach ($stdclassobject as $value) $array[] = $value->post_id;
How to prepare a model to return json_encode data in Codeigniter framework
Here we are fetching data of the projects table and showing returning it in json format. public function projectData() { $result = array(); $data = $this->db->get_where(“projects”)->result(); foreach ($data as $row) { $result[] = array(“myid” => $row->id, “project_name” => $row->project_name, “description”->$row->description); } return json_encode($result); }
Top 10 WordPress Plugins(2018) – For Professional WordPress Websites
1.Nivo Slider (Free + Premium) Sliders and carousels are one of the major and effective elements that boost site’s engagement rate. To display multiple images and show case your works sliders and carousels are better tools. 2.W3 Total Cache (Free + Premium) Caching is one of the best ways to improve website performance. The general … Continue reading
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /opencart-path/system/library/mail.php
Currently i was working in a open cart ecommerce solution and i came across this error: Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /opencart-path/system/library/mail.php on line 168 fsockopen(): unable to connect to :465 (php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, ornot known) in /opencart-path/system/library/mail.php on line 168Notice: Error: php_network_getaddresses: … Continue reading