PHP bidirectional algorithm to find connection between linked users

This is the version (2.0) of our earlier post Find connection path between two users in a social network using PHP and http://blog.kunals.com/php-code-find-2-users-connected-friends-social-network/. In this version bidirectional search is performed from both ends/nodes/users and if found path is displayed. This is based on graph traversal, breadth first search (bfs), bi-directional bfs. Nodes are the users and … Read more

PHP code to find how 2 users are connected through friends in social network

This is the second version of our earlier post Find connection path between two users in a social network using PHP. In this version performance issues have been taken care upto some level along with minor tweaks to code to make it more efficient. Initialising start user, end user, maximum level/degree/depth [php] $user_from=1; //start user … Read more

Find connection path between two users in a social network using PHP

Social networking sites are coming up daily. Users are linked to other users based on various factors like friends, interests, groups, same school, same company, same locality and many more. In all these we are connected to people we know or upto next level that is friends of friends. A need has been identified to … Read more

How to implement Dynamic CSS Sprite Painting effect using CSS and PHP

It is very easy to give a painting effect to images on your website. Just use simple CSS Sprite logic only or use PHP (or other scripting language like ASP etc.) with CSS Sprite to make it easy and more dynamic. Read more about this effect at Dynamic CSS Sprite implementation gives a Painting effect … Read more

How to read an RSS Feed using PHP

There are many ways 2 read XML Feed using PHP. Some basic ways with which this can be done are given below along with code: Basic Way 1 [php] <?php function getFeed($feed_url) { $content = file_get_contents($feed_url); $x = new SimpleXmlElement($content); echo "<ul>"; foreach($x->channel->item as $entry) { echo "<li><a href=’$entry->link’ title=’$entry->title’>" . $entry->title . "</a></li>"; } … Read more

Captcha PHP Script

About (in brief) It does not require images but works on text. Now you can protect your pages with the use of Captcha, you can now have some additional security/authetication/nospam to your web pages. Description An easy to implement Captcha Script which does not require images but works on text. Now you can protect your … Read more