Archive | PHP RSS for this section

Looking for Open Source Charting system? Here it is

After a bit of research and trying with different charting and reporting libraries in Java, C++ etc, I finally found a library which is not only powerful but extremely simple as well.

Open Flash Chart

I must tell you, I have started using it and it is damn good.

The best part being that it has so much of native support to PHP that anyone who loves coding in PHP should fall in love with this graphing library.

VIsit the above URL link and see some demos of how good it is 🙂

Did I tell u that it is totally free, even for commercial use? Simply Awesome. Go check it out.

Cheerz
Shri

If you are reading article, you might also be interested in the PHP and Scriptaculous Book I have authored.

The book gives you insights about effects, drag-n-drop, slideshows, applications, auto-completion, in-place editing and more. Complete code snippets and explanations.

CHECK out and BUY the PHP and Script.aculo.us  book {My Book} at Packt official site
http://www.packtpub.com/php-and-script-aculo-us-web-2-0-application-interface/book

Advertisements

Learn how to play with Flash, Mysql & PHP

Its one of those cool tutorials I have ever come across. It helps us in understaning how to integrate and play with Flash, Mysql and PHP.

I am sure it would help you too.

http://www.creativecow.net/articles/brimelow_lee/php_mysql/php_mysql_flash.html

Cheerz
SHri

If you are reading article, you might also be interested in the PHP and Scriptaculous Book I have authored.

The book gives you insights about effects, drag-n-drop, slideshows, applications, auto-completion, in-place editing and more. Complete code snippets and explanations.

CHECK out and BUY the PHP and Script.aculo.us book at Packt official site

PHP and Script.aculo.us Book

PHP and Script.aculo.us Book

http://www.packtpub.com/php-and-script-aculo-us-web-2-0-application-interface/book

Advanced Word Count for PHP!!!!!

If you have tried counting words in a string in PHP, you sure must have used “explode” function.

Its a pretty simple function and can be used in N-ways. A general simple function can be written as


$String = "This is my blog";
$words = explode(" ",String);
$num = count($words);

Now, this should give you the number of words (4) and following with the count of number of words{This, is, my, blog}.

BUT, the real problem is if your string is “Hello     World”, the number of words here are 7 and count is also 7. How come? THats coz, of the fact the function explode takes delimiter as a space and will count the spaces, commas, etc also as words.

I have found a better way of doing the same. So here I am sharing with you.

Instead use this function, in which we check wheather the word is having any integer, charcter etc in it or not. If its a space we can royally ignore it 🙂

function wordCount($string){
     $words = “”;
     $string = eregi_replace(” +”, ” “, $string);
     $array = explode(” “, $string);
     for($i=0;$i < count($array);$i++)    {          if (eregi("[0-9A-Za-zÀ-ÖØ-öø-ÿ]", $array[$i]))              $words[$i] = $array[$i];      }      return $words;  } [/sourcecode] In this way, we can get the words as the user must have typed omitting the spaces and junk characters. This function will return you a array of words in the string, and further we can even make it only Words++ to count how many words are there. So this function can actually work for 2 purposes. 1. Count the number of Words in a string 2. Get the words in array Hope you find this useful. CHeerz Shri If you are reading article, you might also be interested in the PHP and Scriptaculous Book I have authored.

The book gives you insights about effects, drag-n-drop, slideshows, applications, auto-completion, in-place editing and more. Complete code snippets and explanations.

CHECK out and BUY the PHP and Script.aculo.us book  at Packt official site
mybook

http://www.packtpub.com/php-and-script-aculo-us-web-2-0-application-interface/book

Yahoo SDK & YUI are simply awesome!!!!

I must appreciate the fact on how much Yahoo gives freedom and power to developers through libraries and toolkits.

I am currently using YUI and Yahoo SDK for building a small application and I am highly impressed with the libraries.

For sure Y! are doing great job, making our life lil more simpler 🙂

I have been using some libraries like Rico, scriptaculous, Dojo and trust me when I say, YUI stands tall here.

If you havent tried it yet, get yourself hooked on http://developer.yahoo.com. Loads of tutorials, code, demos. For FREE

Try it now…

Cheerz
Shri

If you are reading article, you might also be interested in the PHP and Scriptaculous Book I have authored.

The book gives you insights about effects, drag-n-drop, slideshows, applications, auto-completion, in-place editing and more. Complete code snippets and explanations.

CHECK out and BUY the PHP and Script.aculo.us book {My Book} at Packt official site
http://www.packtpub.com/php-and-script-aculo-us-web-2-0-application-interface/book

Web Tip #1: Yellow Fade Technique (YFT)

Web 2.0, Web 2.0 *Yawn Yawn*

I guess the web is half full with Web 2.0 jagron. I wont go deep in explaning what exactly  web 2.0 is, but I would stress on one point.

“No Refreshing of Whole Page” {AJAX, as we call it}

I surf web for more than 20 websites {new} a day, one thing I find pretty common and uncommon is the UI. Some sites suck so-much that I never visit them again, and some are so awesome that i fall in love with them.

So here, I am starting a new section “Web Tips” for web workers to plan and design sites in a way to impress the users.

Web Tips #1: Yellow Fade Technique

When you are using AJAX in your site, often one feels it’s a big deal to implement AJAX and then they feel like next Google. But, most of them fail to understand that the user is unaware of what happened just now? For god sake, he doesnt understand AJAX 🙂

So the user panics, can be to an extent, he says “Goodbye”

What can be done to avoid such things? Tell the user you have posted/got the data.

How? Simple

Yellow Fade Technique

Just change the background of the DIV to light yellow and then once the operation is done, again with a time duration fade it out to the original color. This really helps users in understanding that something has happened.

If you are one of the fans of WordPress, it has that implementation in the comments tab.

I am implementing it as well, so you can expect a YFT treat tutorial soon from me.

If you are reading article, you might also be interested in the PHP and Scriptaculous Book I have authored.

The book gives you insights about effects, drag-n-drop, slideshows, applications, auto-completion, in-place editing and more. Complete code snippets and explanations.

CHECK out and BUY the PHP and Script.aculo.us book {My Book} at Packt official site
http://www.packtpub.com/php-and-script-aculo-us-web-2-0-application-interface/book

Cheerz
Sridhar 

Tutorial: How-To make a Tag Cloud using PHP & MySQL

How to make Tag Cloud using PHP & MySQL

Tag Clouds are pretty common now-a-days in almost all the web 2.0 company sites. Be it Technorati, Zoom CLouds, WordPress, Blogger etc.

Why Tag Clouds are important?

Pretty much for the same reasoon: Appealing Users.

On seeing all these even I have decided to introduce the Tag Cloud feature in our project.

Now, the very important question: How do we code to create a Tag Cloud using PHP & MySql?

Here I will show you how to code it.

First the logic:

1. Collect all the tags & Count{how-many times it has been tagged} from DB{MySQL}

2. Put them into a array {PHP}

3. Calculate the maximum and minimum count of the tags used

4. Now, loop through each tag and just change the size of the font.

5. Define a simple class say “wrapper” which will contain the tag clouds

6. Call the function to generate the tag cloud.  {Javascript}

Now, since Im falling short of time, so I will cut the crap and you guys take the code directly.

Yes, a word from me, I will surely update it as time permits in full detail.

Cheerz

Srinix

PS: Download the Code here: Tag Cloud Code

If you are reading article, you might also be interested in the PHP and Scriptaculous Book I have authored.

The book gives you insights about effects, drag-n-drop, slideshows, applications, auto-completion, in-place editing and more. Complete code snippets and explanations.

PHP and Script.aculo.us Book

PHP and Script.aculo.us Book

CHECK out and BUY the PHP and Script.aculo.us book at Packt official site
http://www.packtpub.com/php-and-script-aculo-us-web-2-0-application-interface/book

FPDF, PDFLib with PHP which one to choose?

FPDF is a php class used to generate PDF files out of text or html files. ‘F’ stands for Free.

Whereas PDFLib is also a powerful class for generating PDF files, but its not free.

Have you tried any of these with PHP? Which one would you prefer?

In terms of features, customization, encoding facilities and above all performance. Have you tried using ajax to get data from mysql and then post it to create PDF using PHP?

This weekend, I am working on both of them, if you happen to work on them already. Please drop me a line.

Cheerz
Sridhar