<?php function getAllDatesBetweenTwoDates($strDateFrom,$strDateTo) { $aryRange=array(); $iDateFrom=mktime(1,0,0,substr($strDateFrom,5,2), substr($strDateFrom,8,2),substr($strDateFrom,0,4)); $iDateTo=mktime(1,0,0,substr($strDateTo,5,2), substr($strDateTo,8,2),substr($strDateTo,0,4)); if ($iDateTo>=$iDateFrom) { array_push($aryRange,date('Y-m-d',$iDateFrom)); // first entry while ($iDateFrom<$iDateTo) { $iDateFrom+=86400; // add 24 hours array_push($aryRange,date('Y-m-d',$iDateFrom)); } } return $aryRange; } $fromDate = '2014-07-24'; $toDate = '2014-07-31'; $dateArray = getAllDatesBetweenTwoDates($fromDate, $toDate); print_r($dateArray); ?>Output will be :
Thursday, 24 July 2014
Get all dates between two dates using php code.
Friday, 13 June 2014
Get Facebook Likes Count of a page using Graph API
<?php //The following code returns the Number of likes for any facebook page. //Page Id of Knowledgecotner Replace it with your page. $page_id = "556271807742934"; $likes = 0; //Initialize the count //Construct a Facebook URL $json_url ='https://graph.facebook.com/'.$page_id.''; $json = file_get_contents($json_url); $json_output = json_decode($json); //Extract the likes count from the JSON object if($json_output->likes){ $likes = $json_output->likes; } //Printing the count echo $likes.' Facebook Fans'; ?>
Tuesday, 10 June 2014
How To Display Twitter Followers Count In PHP
Friday, 6 June 2014
Php : create pdf from html using mpdf
MPDF
Friday, 30 May 2014
Monday, 12 May 2014
Get User info using JS SDK after login with Facebook
To day iam working with facebook js sdk it is very easy to get user details after user login to facebook.
<script src="http://connect.facebook.net/en_US/all.js"></script> <script type="text/javascript"> FB.init({ appId : 'your AppId', status : true, cookie : true, xfbml : true }); FB.login(function (response) { getFBuserData (); }); function getFBuserData () { FB.api('/me', function(data){ var userdetails = data.first_name+ data.last_name + data.id+data.gender+data.link+data.birthday+data.email; alert(userdetails); }) } </script>
Friday, 9 May 2014
How to install SSL Certificates with Apache 2 on Ubuntu
Step – 1 Create a Certificate Signing Request(CSR file)
In the DN for most servers are the following fields: Country, State (or Province), Locality (or City), Organization, Organizational Unit, and Common Name.
Subscribe to:
Posts (Atom)