Enable session WordPress

Enable session WordPress

Add the following code in function.php to enable or start session in wordpress


By bm on August 30, 2017 | php, wordpress | A comment?

Implementing Google Sign-In for Websites java script and PHP

Implementing Google Sign-In for Websites java script and PHP

First step you need to create a google client id

Go to

then create a new project or select an existing project


create project


I am going to create a new project (If you are having a project already you can select that one also)

new project


Enable google+ Api

enableing google pluse

enableing google pluse 2



Choose an Email Address, specify a Product Name, and press Save.

create creadential

In the Credentials tab, select the New credentials drop-down list, and choose OAuth client ID.

create creadential2

Under Application type, select Web application.

create creadential3


create creadential4


Copy the client id from the google developer console and past it in to the meta tag of the bellow index,html “<YOUR CLIENT ID>”



Server side verification (PHP)


Out Put






By bm on June 29, 2016 | html, java script, php | A comment?
Tags: , , ,

PHP replace between

In this snippet I am just creating an useful function to replace string in between two string (including the given string )

The replace between function definition

sample function calls

sample 1


<div>W d e f g a x c </div>


sample 2


<div>some text  </div>

Using preg_replace()


<div>abc  ddfsdfed </div>




By bm on June 24, 2016 | php | A comment?
Tags: , ,

PHP call REST api


ref: –

By bm on June 15, 2016 | php | 1 comment

Download as pdf using phpExcel and tcpdf

Download phpexcel :

Download tcpdf :


By bm on May 17, 2016 | php | A comment?

Download as excel using PhpExcel

Download phpexcel :


By bm on May 16, 2016 | php | A comment?