Using preg_split() to explode() by multiple delimiters in PHP

Just a quick note here. To explode()  a string using multiple delimiters in PHP you will have to make use of the regular expressions. Use pipe character to separate your delimiters.

There are also various flags you can use as optional: Continue reading “Using preg_split() to explode() by multiple delimiters in PHP”

How to use PHP to insert content after or before HTML tag

The problem is quite simple…you just want to count a specific tag on a page and insert some content. After or before it’s just a matter of perspective. So let’s say you want an ad, for example, to be inserted, after the fourth H2 tag. So let’s go and insert an ad code or any other content block after some HTML tag. Here we have a simple PHP function: Continue reading “How to use PHP to insert content after or before HTML tag”

Simple OAuth2 authorization code grant example using PHP and cURL

The authorization code grant methods, should be very familiar if you’ve ever signed into an application using your Facebook or Google account.

The flow is quite simple. The application redirects the user to the authorization server >> the user will then be asked to log in to the authorization server and >> approve access to his data. And if the user approves the application  >> he will be redirected back to the application. Continue reading “Simple OAuth2 authorization code grant example using PHP and cURL”

Limit the number of keywords in WordPress tag cloud to control PageRank

Did you know that the default wordpress tags, labels or keywords from the sidebar can have a huge impact on your website? Well it does.

Beginning with Version 2.8, the default tag limit in wordpress is set to 45, witch is quite large and can definitely affect PageRank on small blogs with less PageRank to spread around. However the net affect can still be helpful on high authority blogs. Continue reading “Limit the number of keywords in WordPress tag cloud to control PageRank”

Build your own WordPress Twenty Sixteen Child Theme

Child themes are very popular these days. We will create a simple child theme for the Twenty Sixteen, one of the main standard WordPress themes.

To get started we will create a folder and we will name it twentysixteen-child . Then we will create a style.css inside this folder. Continue reading “Build your own WordPress Twenty Sixteen Child Theme”

How to embed video into a website – Ultimate tutorial

Embedding a video into HTML website seems an easy task, but there really are lots of aspects to take into consideration when you insert a video:

  • File size and format (extensions and codecs)
  • Browser and platform compatibility
  • User internet connection (mobile vs desktop devices)
  • Server resources (bandwidth, CPU, RAM)
  • Privacy and data owning
  • Content visibility and engagement

Therefore, depending on where you will insert the video and the application you use, you will be affected by some of the above or not. So let’s get our hands on it and do a step by step research about what is the simplest way to embed a video. Continue reading “How to embed video into a website – Ultimate tutorial”

7 years Google Adsense earnings statistics and 10.000$ barrier reached

If you are on this page, there are lots of chances you have a Google Adsense account, you are planning to create one, or Google just close the account you had.

This is where I will tell you what I’ve learned in my 7 years experience with Google Adsense and how I reached the $10,000 barrier. But before I get into more details, let me tell you how I have started. Continue reading “7 years Google Adsense earnings statistics and 10.000$ barrier reached”