Why You Should Migrate From Python To GoLang?

PHP

Why You Should Migrate From Python To GoLang? 04Dec, 2018

Why You Should Migrate From Python To GoLang?

Why Do You Need A Switch From Python To Go? There are many factors at play when you want to use a language for a project or product. Certain choices have to be made and there are obviously hard decisions that affect your product in the long run. A lot of companies are changing their core service back end from Python to Go. Reasons are aplenty and for the ones out there who are contemplating the same keep on reading to find out more What Matters The Most Is The Performance Go assures performance which makes it a clear winner, both at runtime and compile time. When we talk about computing benchmarks it is very much comparable to Java or…

5 Common Hreflang Mistakes You Might Be Making 15Nov, 2018

5 Common Hreflang Mistakes You Might Be Making

Are you thinking about how to add hreflang tags in html? Are you wondering what will happen if you used them on your duplicate content? How do you fit hreflang in SEO? What would it do to your website ranking in the long run? Before you make a mistake while implementing this tag, understand the following: Hreflang Attribute The hreflang attribute is widely referred to as rel=”alternate” hreflang=”x”. It tells the leading search engines (Google) which language you use on a specific page. Based on that the search engine serves relevant results to your users who are searching in that language. Before You Go About Randomly Implementing This Tag All Over Your Web Pages, Understand The Most Common Hreflang Mistakes…

7 Of The Hottest Personal Trainer Web Design Trends 2018 04Jul, 2018

7 Of The Hottest Personal Trainer Web Design Trends 2018

It doesn’t matter whether you are a fitness enthusiast trying to make it big as a professional or a certified fitness trainer working hard to make an impression on their audience and get back into the game. What you need is a reliable and meticulous website design for personal trainers that can highlight you and your services better. But it isn’t going to be the same this time around. The run of the mill designs don’t work anymore. Your audience has grown bored of the repetitive patterns and the stale gimmicks used by fitness website developer teams to enhance your online presence. It is time to instruct your custom gym website development company to revamp its processes to attract and…

The HipHop Compiler (HHVM) for PHP 27Nov, 2014

The HipHop Compiler (HHVM) for PHP

Today I am going to share an interesting article with you all. Although we all know, Facebook, the most used social network with over 1.3 billion active users worldwide, as of June 2014, is built on PHP. PHP is the most common scripting language for server side web development. So the problem in scripting language in general is their performance. They are easy to learn, easy to use, feature rich, but lack in performance. Below is the set of different languages for it’s performance against the CPU timing.   Therefore, this performance issue creates lots of implications for facebook. Bad performance can limit a lot of features for users, and requires lots of resources. So that raises a question for facebook….

Posted in: PHP
Creating automatically link from string url 16Mar, 2012

Creating automatically link from string url

Here is the function makeLinkActive to create autmoatically hyperlink( <a href=” “></a> ) in string where it will find url in a string Parameters : $string : String to find http (In this example : ‘This is good boy . http://www.youtube.com/watch?v=ehuwoGVLyhg&feature=topvideos Hello this is test http://mysql.zapbuild.com/index.php?db=dev_behum&table=admins&token=34a15b853f779f699687d3594799796c my test’ is string) Here is the source Code: $str = “This is good boy . http://www.youtube.com/watch?v=ehuwoGVLyhg&feature=topvideos Hello this is test http://mysql.zapbuild.com/index.php?db=dev_behum&table=admins&token=34a15b853f779f699687d3594799796c my test”; function makeLinkActive( $string=” ){ preg_match_all(‘#bhttps?://[^s()<>]+(?:([wd]+)|([^[:punct:]s]|/))#’, $string, $match); $urls = $match[0]; $links= array(); foreach( $urls as $key => $url ) { $links[$key] = “<a target=’_blank’ href=’$url’> $url </a>” ; } return str_replace($urls,$links,$string) ; } echo makeLinkActive( $str ); //calling function OUTPUT: This is good boy . <a target=’_blank’ href=’http://www.youtube.com/watch?v=ehuwoGVLyhg&feature=topvideos’> http://www.youtube.com/watch?v=ehuwoGVLyhg&feature=topvideos </a>…

Posted in: PHP
Insert line break in long string. 15Mar, 2012

Insert line break in long string.

Here is the function stringWrap to insert <br> in long string as a single word according to the charachters mentioned. Parameters : $string : String to insert line breaks(In this example : ‘rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr’ is string) $length : after how many characters line breaks( <br> ) will insert specified(In this example : ‘5’ is length) Here is the Code: function stringWrap( $string, $length){ $subStr = $string ; $myString = ”; $lastIndex = 0 ; while($subStr){ $subStr = substr($string,$lastIndex,$length) ; $lastIndex += $length; $myString .= $subStr .'<br/>’; } return $myString ; } echo stringWrap( ‘rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr’, 5); //calling function OUTPUT: rrrrr<br/>rrrrr<br/>rrrrr<br/>rrrrr<br/>rrrrr<br/>rrrrr<br/>rrrrr<br/>rrrrr<br/>rrrrr<br/>rrrrr<br/>rrrrr<br/>rrrrr<br/>rrrrr<br/>

Posted in: PHP
Find number of weekdays (Mon, Tues etc)  between  two dates 08Dec, 2011

Find number of weekdays (Mon, Tues etc) between two dates

<?php function workingDays( $fromDate, $interval ) { $date_array = explode(‘-‘, $fromDate ); $day = $date_array[0]; $month = $date_array[1]; $year = $date_array[2]; $working_date = array(); for ( $i = 1; $i <= $interval; $i++ ) { $working_date[] = date(“l”, mktime(0, 0, 0,$month,$day +(int)$i,$year)); } return $working_date; } $getDays = workingDays(’30-11-2011’, 30 ); str_replace(array(‘Friday’),array(‘Friday’) ,$getDays, $dupweekDays); // trick to check the occurrence of week days echo $dupweekDays; ?> Explanation of the above code: $getWorkingDays = workingDays(’30-11-2011′, 30 ); W call the workingDays function it accept two prams a) the start date 2) the number of days between to dates This function will return the name of weekdays i.e Monday, Tuesday,Wednesday , Thursday , Friday , Saturday , Sunday ——————————————————————————————————————————————————————————————————————-Below is str_replace(array(‘Friday’) ,…

Posted in: PHP
Overcome XSS scripting or cross site scripting 17Feb, 2011

Overcome XSS scripting or cross site scripting

Just paste this code in a header file which is included in the site. You can exclude the fields like description while filtering the POST And GET. foreach ($_GET as $key => $value) { $_GET[$key] = strip_tags($value); } foreach ($_POST as $key => $value) { $_POST[$key] = strip_tags($value); } foreach ($_SERVER as $key => $value) { $_SERVER[$key] = strip_tags($value); }

Posted in: PHP
Facebook Connect in Php 30Dec, 2010

Facebook Connect in Php

Facebook Connect in PHP,Just Follow these Steps :- Upload all the files of zip folder on server.(Attached with this post) Step 1 : Just open the file where you have to use facebook connect.(e.g abc.php) Step 2: Just include this javascript file in head :- “<script src=”http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php” type=”text/javascript”></script>”. Step 3: Include the file “facebook.php”(Uploaded with this post). Step 4: To put login button of facebook connect :- <fb:login-button onlogin=’window.location=”http://www.xyz.com/abc.php”;’ size=”medium” background=”white” ></fb:login-button> Step 5: create the object :- $facebook = new Facebook(‘Facebook API key’,’Facebook App Secret Key’,true); Step 6: To get the user id of facebook login person:- “$fUserId = $facebook->get_loggedin_user();” Step 7: To get the session key for the api -> $fc = new FacebookRestClient(‘facebook Api keyApi secret key’,$facebook->api_client->session_key);…

Posted in: PHP
PHP script – how to find the working days from a specified date? 21May, 2010

PHP script – how to find the working days from a specified date?

<?php /* This is a function to find out working days from a specified date and format of date must be dd-mm-yyyy First parameter to function is the date from which working days are to be calculated (working day exclude Sun and Sat) Second parameter to function is the number of working days to be calculated */ function workingDays( $fromDate, $interval ) { $date_array = explode(‘-‘, $fromDate ); $day = $date_array[0]; $month = $date_array[1]; $year = $date_array[2]; $working_date = array(); for ( $i = 1; $i <= $interval; $i++ ) { $day_text = date(“D”, mktime( 0, 0, 0,$month,$day + (int)$i,$year)); if( $day_text == ‘Sat’ || $day_text == ‘Sun’ ) { $interval++; continue; } $working_date[] = date(“F j, Y”, if (1==1)…

Posted in: PHP