Tips & Tricks Tutorials

How to get the Widget ID in WordPress

If you are customizing the WordPress theme or working on your own theme, you might need a widget ID to make everything work like you want. For example, if you want to hide the widget on a specific page, you will need to provide a widget ID to make the code work. In this tutorial, we will show you how to get the widget ID in WordPress. Get the widget …

Continue reading

How to Remove Special Character from String in PHP

In this tutorial I will show you how to remove special character from string in PHP. Sometimes we need to remove all special characters by using preg_replace from input string. There are two option available to remove special character from string using php. Option 1: Using preg_replace PHP Function We can remove special character from sting using preg_replace, it’s using regular expression to special character from string. Syntax of preg_replace …

Continue reading

How to Remove Duplicates from Multidimensional Array

In this tutorial I will show you how to remove duplicates from multidimensional array in PHP. array_unique() function works on single dimensional array not on multidimensional arrays. After googling I have found a way to get unique multidimensional array using serialization of array. Serialization is used to storing or passing PHP values around without losing their type and structure. Steps to remove duplicates from multidimensional array 1. We will use …

Continue reading

How to protect your WordPress from XML-RPC attack

WordPress is the most popular Content Management System. This popularity makes WordPress a perfect target for hackers. The most common attack faced by a WordPress site is XML-RPC attack. The WordPress XML-RPC is a specification that aims to standardize communications between different systems. It uses HTTP as the transport mechanism and XML as encoding mechanism which allows for a wide range of data to be transmitted. Today in this tutorial …

Continue reading

How to check if my info was shared with Cambridge Analytica?

After the Cambridge Analytica Scandal, every person on Facebook is worried that his personal information has not been sold anywhere. According to the information, out of billions of Facebook users, 8.7 million people have been injured in personal information. You are not even one of them! You can find this as follows. Facebook is informing every user that his personal data is safe or not. If you have not received …

Continue reading

How to Convert XML into Associative Array in PHP

In this tutorial I will show you how to convert XML into associative array in php. I have found several methods and library to convert XML into array and following is a simple script to convert xml into array. I am using file_get_contents() php method to read xml file data into string. Steps to Convert XML into Associative Array Step 1: Following is a sample XML file books.xml Step 2: …

Continue reading

Get Images from your Instagram Account

Get Images from your Instagram Account

In this tutorial I will show you how to get images from your Instagram account. To get images from Instagram we need Access Token and Instagram user ID. Please read previous posts Get Instagram Access Token Using Client-Side Authentication and How to get Self Instagram User ID to get Access Token and Instagram user ID. Get images from your Instagram Account Now we will use file_get_contents method to get remote …

Continue reading

How to get YouTube subscribers count in php

How to get YouTube subscribers count in php

In this tutorial I will show you how to get YouTube subscribers count in php using api v3.0. We need just an API KEY to get work. Below I am sharing all the steps to get api key and get subscribers count. How to get YouTube API key Below are the steps to get YouTube API key 1. Go to https://console.developers.google.com/ and login to your google account. 2. Navigate to …

Continue reading