Friday 29 April 2011

Is “Chalta Hai” your defining motto?

Most young people have similar goals. They want to be loved, healthy, happy, and successful. And rich! And here’s the problem

WANT to go somewhere but don’t know the way? Simple. Just punch in your destination on one of those websites that offer maps and – bingo – you will get directions on how to get there. Unfortunately, that’s not the case with your goals in life. Those websites don’t offer roadmaps to get to your goals!

Most young people have similar goals. They want to be loved, healthy, happy, and successful. And rich! And here’s the problem. As we set off on the journey towards our goals, two paths emerge ahead of us. One looks like a fast and easy road – full of short cuts. It’s the path of least resistance. And the other is a long hard road, often strewn with obstacles. And - no prizes for guessing – most of us take the easy way out!

And that becomes a habit. We look for short cuts all the time. We compromise. We don’t push ourselves to succeed; we merely set ourselves the objective of not failing. We don’t play to win. We just want to avoid losing.

And so we love tips like “If you study these three sections, you can get 35 marks”. Or ‘if you attend classes twice a week, you won’t be in the black list.” Unfortunately, this attitude pervades our life and becomes a habit. We stop striving for the greatness that we are all capable of. “Chalta Hai” becomes our defining motto. And as someone rightly said, ‘Good is the enemy of Great’.

There once lived a sculptor in a small town. He was working on a huge idol of a Goddess that he was making for the local temple, when a young man walked into his workshop. As the young man marveled at the idol, he suddenly noticed another idol, almost identical, lying on the ground. “Do you need two of these?” he asked. “No,” came the reply. “We only need one. But the first one got damaged in the finishing stages. Hence I am doing it again.”

The young man looked closely at the idol on the ground. It looked perfect. He could not see any signs of damage. “Where is the flaw?” he asked. “Look carefully,” said the sculptor, “and you will notice a scratch under the left eye.” “Wait a minute!” said the young man. “Where will this idol be installed?”

The sculptor explained that it would be on a platform fifteen feet high inside the temple. And the young man quickly retorted, “At that distance, who will know there is a scratch beneath the eye?” The sculptor smiled and said, “I will.”

Now that’s a good reminder of what excellence is all about. It comes from inside, not from outside. And it’s an attitude. One we would all do well to inculcate.

Commit to doing your best at all times. Don’t compromise, ever. Whatever you do, give off hundred percent. Aim to be the best at whatever you do. And do that not because someone else tells you to do it – but because YOU want to.

And make sure you always, always do the right thing. Don’t tell yourself it’s okay, no one will notice. Remember, someone is watching all the time. And that someone is you. Your character is defined not by how you behave when you know others are watching – but by what you do when no one is looking.

If you create an idol with a scratch and think no one will notice, you will soon find another scratch appearing in your work and then another. And you will spend a lot of time and effort hiding those scratches, covering up, hoping no one notices. And instead of becoming a master sculptor, you become a patch-up artist. And your life – instead of becoming a masterpiece – becomes just another flawed piece of work. And in either case, what makes the difference is not the skill. It’s always your attitude.

Get the sculptor’s attitude. Commit to excellence. And make your life a masterpiece.

Prakash Iyer is MD, Kimberly-Clark and Executive Coach.


You Must Have Winning Habbit...

How Yusuf Pathan, Tiger Pataudi, Hokaito Zhimomi did it


Not everyone can become an India player but that should not stop you from trying or make your achievements any less significant.

THE Cricket World Cup is here! And cricket fever is everywhere. Sport is a terrific metaphor for life, and there are several useful lessons that cricket can throw up for all of us. Here then are three lessons from cricket for the larger game of life.

1. It’s not what happens to you that matters: it’s what you do about it that counts. He was a prince. Educated at Oxford. Handsome. And a terrific cricketer to boot. At 20 years of age, Tiger Pataudi had the world at his feet. Suddenly, disaster struck. In a tragic car accident, Tiger lost his right eye. Imagine! His world came crashing down.

He recalls trying to pour tea from a pot into a cup – and spilling it all over. What chance would he have of ever holding a bat again? After all, keen eyesight was seen as an essential ingredient for success. Would that be the end of his cricketing career?

Tiger may have lost an eye, but instead of focusing on what he had lost, he chose to focus on what he still had: the determination to succeed, the willingness to work hard – and the mindset of a winner. And of course, one good eye. For Tiger, losing an eye was only one more challenge to be overcome on the long road to success.

Tiger went on to play with distinction for India, became India’s youngest captain – and remains one of the greatest names in Indian cricket. Setbacks are inevitable but how you respond defines your achievements. Next time adversity strikes don’t wallow in self-pity. Be a Tiger!

2. Run your own race: Don’t compare yourself with others; just aim to be the best you can be. Have you heard of Hokaito Zhimomi? Probably not. He is a cricketing hero, the greatest cricketer his State has produced. Idolised by fans , he is an inspiration to young players in his homeland. His claim to fame? In 2008, he became the first cricketer from Nagaland to make it to the big league when he was selected to play for the Kolkata Knight Riders in IPL. It doesn’t matter that he’s never played for India. He is a hero in his own right. A village lad who worked his way to the top and became an inspiration for sportsmen in the region.

Not everyone can become an India player. Or become CEO. But that should not stop you from trying or make your achievements any less significant. Run your own race. Don’t compare yourself with others. Doing well in class is important. You don’t have to come first. Being a successful manager is big. You don’t have to be CEO. Just as being Zhimomi is a big deal. Not everyone can be a Tendulkar!

3. An extra 30 minutes of effort every day can change your life! Until a few months back, Yusuf Pathan was just another big-hitting T-20 sensation with a not-so-successful limited overs track record. Pathan’s career had seen ups and downs. And then suddenly in the last few months, he seems to have changed gears, winning games from seemingly hopeless situations. He is a changed man now, and undoubtedly one of the most exciting prospects in the World Cup. How did the transformation happen? How did Yusuf do it?

In an interview with a newspaper, Pathan explained the secret: “I would always bat for that extra 30-40 minutes after others would leave and that would allow me some undivided attention in which I could pick the coach’s brains.” Easy does it. Just an extra 30 minutes. That’s all it takes. Hard work has its rewards. Just think. What can those 30 minutes do to your career? Make sure you spend an extra 30 minutes every day, getting better. Do the Pathan thing. And see the difference!

Yusuf’s mantra: Batting for an extra 30-40 minutes after practice, gets you the coach’s undivided attention.

Prakash Iyer is MD, Kimberly-Clark, and executive coach. He has recently authored a book titled 'The Habit of Winning'.


Monday 25 April 2011

Mastermind success! You can, if you think you can

Prakash Iyer says it is a only mental block that prevents one from achieving any goal.

Have you heard of Roger Bannister? He was the first athlete to run the mile in less than four minutes.

In doing so, he not only broke the four-minute barrier, but also taught us all a valuable lesson.

Back in the 1950's, the world record - 4 minutes 1.4 seconds - was held by Sweden's Ginder Haegg. The record stood for several years since it was set in 1945. Athletes, experts and the world were convinced that it was impossible to run a mile in less than four minutes. Some even argued that the human body was biologically incapable of running the mile in less than four minutes!

And then, on 6th May, 1954, Roger Bannister did the impossible. He broke the four minute barrier, finishing the race in 3 minutes, 59.4 seconds.

His rival - Charles Landy - had thrice run the mile in less than 4 minutes 2 seconds without breaching the 4 minute mark. The four minute barrier was "like a wall", Landy had said. But guess what? Just 56 days after Bannister's feat, Landy ran the mile in 3 minutes 57.9 seconds. And by 1957, 16 athletes around the world ran the mile in under 4 minutes. The 4 minute mental barrier was truly shattered!

What really happened? Did coaches get smarter and teach the athletes new techniques? Did running shoes get more sophisticated? Did bodies suddenly get stronger? No. The 4 minute barrier it turned out was not a physiological one - just a mental one! As Roger Bannister explained later, it seemed illogical that you could run a mile in 4 minutes and a bit, but not break 4 minutes. His mind refused to accept that barrier. That made all the difference.

Once that mental barrier was broken by Bannister, everyone believed it could be done! And once the belief changed, the rest was easy.

It's important to understand that our achievements in life are limited not by what we can do, but by what we think we can do. More than ability, it's our attitude that makes the difference. As Henry Ford said, "If you think you can, you can. And if you think you can't, you are right".

You will probably find your mind constantly grappling with two competing thoughts: 'I can't!' and 'I can!' How do you ensure the 'I can' wins? How can we break our mental barrier of 'I can't'?

There was a man in Alaska who had a black dog and a white dog. His dog fights attracted large crowds. Every week people would bet on which dog would win. Sometimes the black dog won, and sometimes the white one. One lady noticed that no matter which dog won, the owner always bet on the right dog, and won each week. When the man retired the two dogs, the lady asked him the secret.

"Simple," said the man. "I always bet on the dog I had been feeding all week."

So whether 'I can't' wins in your mind or 'I can', depends on which thought you are feeding!

Feed the 'I can' dog in your mind. The thought you feed, grows! Focus on your strengths, and they will grow. Or keep thinking of your weaknesses and your fears. And unfortunately they'll grow too.

You won't always find a Bannister to break your mental barrier. You need to do it yourself. Once you start feeding the 'I can' thought, you will achieve more than you ever thought was possible!

Thursday 21 April 2011

Obstacles helped these men earn mega success



Learning to cope with failures is the first and most crucial step towards success.

AT age 10, Julio was a little Spanish boy with a dream. He wanted to play football for his favourite club – Real Madrid! He played all day, practised hard and became a very good goalkeeper.


By the time he was 20, the childhood dream was beginning to come true. He was signed up to play for Real Madrid. And most football pundits were predicting that young Julio would soon become Spain’s No.1 goalkeeper.

One evening in 1963, Julio and his friends set out in a car for a night of fun. It turned out to be a night of horror, as the car they were travelling in met with a terrible accident. And young Julio – soon-to-be star goalkeeper of Real Madrid and Spain – found himself in hospital, paralysed from the waist downwards. Doctors were unsure if he’d ever be able to walk again. They were pretty sure he would never play football again.

The road to recovery was long and painful. Julio spent the night thinking about what might have been. His mind was filled with sorrow, anger, regret. To lessen the pain, he took to writing songs and poems at night, with a tear in his eye and a pen in his hand. And to increase the dexterity in his hand, a nurse gave him a guitar. He had never touched a guitar in his life! But soon Julio began strumming the guitar and also singing the songs that he had been writing.

After being bed-ridden for 18 months, Julio gradually picked up the pieces of his life. Five years after the accident, Julio entered a singing competition – and won the first prize - singing a song called “Life goes on the same!”

He never played football again. But with a guitar in hand and a song on his lips, Julio Iglesias went on to become one of the top ten singers in the history of music, selling over 300 million albums. Just imagine. If not for that accident, Julio Iglesias would have probably been just another goalkeeper in Europe!

What happened to Julio that evening in 1963 could happen to any of us. A setback or an accident – or failure - can often appear to be the end of the road. But it seldom is. When one door shuts, usually another one opens. It’s just that we get so busy staring at the closed door and banging our head against it that we fail to spot the other door opening. Learning to cope with failure is often the first – and most critical step – towards success.

Never let failure impact your sense of self-belief. You are a star, with unique talents. Didn’t clear the entrance exam to engineering college? Maybe you weren’t meant to be an engineer. That’s all.

Even Albert Einstein didn’t clear the entrance exam to join a polytechnic. But he didn’t do too badly, did he? Maybe there is a better, brighter career waiting for you. The trick is to move on and like Julio, tell yourself that “Life goes on the same”.

Several years ago, a bright little boy in a government school in Kerala had a dream. He wanted to be a doctor. He did well in school, and everybody was convinced that this little boy would someday become a fine doctor. He wrote the entrance exam – but failed to make the cut! He was devastated.

His parents were shocked. He went on to do a BSc then a Masters degree, worked with an IT firm – and later went on to found Infosys. His name? Kris Gopalakrishnan, CEO, Infosys. Just imagine. Had Kris not failed the medical entrance, he may have been in some little town in Kerala today, prescribing antibiotics for a runny nose or a nagging flu. Imagine!

Good lesson to learn from Julio. And from Kris. When one door shuts, another one opens. Just believe in yourself. Next time you are faced with a failure or a setback, look out for the other door. Push it open. And go find your place in the sun!

Prakash Iyer is MD, Kimberly-Clark, and executive coach.

Want to be a winner? Just do it!

Here's a simple question to get you started. There are three monkeys sitting on a tree, above a pond. One of the monkeys decides to jump into the pond. How many monkeys are left on the tree? Two? Wrong.

The right answer is three. You see, the monkey only made the decision to jump into the pond. He didn't actually jump! If you think about it, we are all like that. We take decisions. We make resolutions. But somehow, we don't follow through with action. And intent without action is quite useless, really. Getting started - taking that first step - is often the master key to success. As someone once said, you don't have to be great to get started. But you sure have to get started to become great!

Do you find yourself struggling to take action on your plans and intentions? Well, here's a five-point programme to help you move from intent to action.

Make a beginning ? right away. Whatever be your goal, take the first step - however small - right away. Until you take that first step, your mind does not believe you. You need to signal to yourself that you are serious, that you mean business. Commit to taking action, immediately. Today. Now.

Break up the grand plan into smaller tasks. Remember, a journey of a thousand miles begins with a single step. Sometimes the task ahead looks so enormous that we feel overwhelmed - and we don't do anything about it. Break that up into smaller sub-tasks, and suddenly you'll find something that's doable. Remember that old adage &lsquosomething is better than nothing'? It's still true.

Think of the pleasure, not the pain. Visualise success. If you want to do an MBA at a premier school and plan to devote three hours a day to studying, don't think about missing the football game on television, or about not being able to go out for that Saturday night bash. Think instead of the job that you could get post your MBA, the rewards that it would bring, the dreams that would get realised.

Create a support group. Surround yourself with people who share your objective, who are co-passengers on your journey to success. The excitement of being in it together will help you fight the inertia, and get you going with the rest of the gang.

Pay up ? in advance. For most of us, monetary commitments are a strong impetus for action. The fear of losing money or wasting it, can spur you into action. We follow up on our commitments, if only to ensure our money is well-spent. Plan to lose weight? Pay up for that three-month weight loss programme! Don't wait.

Surround yourself with people who share your objective, who are co-passengers on your journey to success.

Bestselling management author Tom Peters tells the story of a man who approached American financer and banker JP Morgan with an envelope, and said, "Sir, in my hand I hold a guaranteed formula for success, which I will gladly sell you for $25,000."

"Sir," JP Morgan replied, "I do not know what is in the envelope. However, if you show me, and I like it, I give you my word as a gentleman that I will pay you what you ask." The man agreed to the terms, and handed over the envelope. JP Morgan opened it, and pulled out a single sheet of paper. He gave it one look - a mere glance - then handed it back to the gentleman. And paid him the agreed-upon sum of $25,000! On that sheet of paper, were two things:

JP Morgan benefited from this advice, and you can too. Knowing what to do is often easy. We all have our list of things to do. Our plans and our resolutions. Doing it - that's the tough bit. But that's the hallmark of successful people. The Nike guys are right. Want to be a winner? Just do it!

Wednesday 20 April 2011

PHP – Take advantage of language constructs



  • Fastest things in PHP are the language constructs.




  • They are highly optimized in the interpreter




  • Don’t require calling external libraries




  • Don’t call a function if there is a language construct. As an example, using a casting operator like (int) $total is much more efficient than using the function intval($foo)




  • Function calling generate considerably amount of overhead. Using a language construct avoid




  • isset() and unset() are both language constructs, even though they mostly act like functions. However calling them does not generate the function overhead.




Some common language constructs are:





  1. echo()




  2. empty()




  3. isset()




  4. unset()




  5. eval()




  6. exit()




  7. die()




  8. include()




  9. include_once()




  10. require()




  11. require_once()




  12. return



What is Web Service?

Web Services is a generic umbrella that describes how disparate systems can integrate with each other over the web.
Most major sites offer some form of web services:
– Amazon
FedEx
eBay
– PayPl
– del.icio.us

Why use Web Services?

  • Someone else has data you need

  • Easier than scraping pages also more reliable

  • Automate processes

  • Provide additional information to your clients


REST

REST Request

http://library.example.com/api.php?devkey=123&action=search&type=book&keyword=style

After the request, we will get the answer or response as an XML file. we can simple parse them using PHP’s SimpleXMLElement (SAX API) or DOM API to retrieve data

Zend Framework for developing Web Application using PHP

There are many frameworks for developing web applications using PHP. CodeIgniter, CakePHP, Symphony and more.. I’ve not much experience in all the frameworks. I’ve a good experience in using CodeIgniter and some small MVC frameworks.

Recently I am Working on Zend Framework .  I noticed Zend Framework is a nice framework to develop web application. Zend finally give special notice to develop a very good framework. And I hope very soon, Zend Framework will lead among all. I found this framework is very essential and powerful.

Recently,

What is Zend Framework?

  1. Zend Framework is a simple, straightforward, open-source software framework for PHP 5 designed to eliminate the tedious details of coding and let you focus on the big picture.

  2. It follows Model-View-Controller (MVC)

  3. ZF follows good coding-convention.


Documentation:
Documentation is really rich. Its not take much time to grasp a basic concept of this framework to develop application. Because there is quick start, api documentation, component based documentation. Overall I rate 10 out of 10 grade in documentation.

Goals of Zend Framework Components:


  1. Zend_Acl


    Zend_Acl provides lightweight and flexible access control list (ACL) functionality and privileges management.


  2. Zend_Auth


    Zend_Auth provides an API for authentication and includes concrete authentication adapters for common use case scenarios, as well as “Identity 2.0″ adapters such as OpenID and Microsoft InfoCard.


  3. Zend_Cache


    Zend_Cache provides a flexible approach toward caching data, including support for tagging, manipulating, iterating, and removing subsets.


  4. Zend_Config


    Zend_Config simplifies the use of configuration data for web applications.


  5. Zend_Controller and Zend_View


    These components provide the infrastructure for a Model-View-Controller (MVC) website.


  6. Zend_Date


    Zend_Date offers a detailed but simple API for manipulating dates and times.


  7. Zend_Db


    This is a lightweight database access layer, providing an interface to PDO and other database extensions in PHP. It includes adapters for each database driver, a query profiler, and an API to construct most SELECT statements.


  8. Zend_Db_Table


    The Zend_Db_Table component is a lightweight solution for object-oriented programming with databases.


  9. Zend_Feed


    This component provides a very simple way to work with live syndicated feeds.


  10. Zend_Filter and Zend_Validate


    These components encourage the development of secure websites by providing the basic tools necessary for input filtering and validation.


  11. Zend_Filter_Input


    This is a configurable solution for declaring and enforcing filtering and validation rules. This component serves as a “cage” for input data, so they are available to your application only after being validated.


  12. Zend_Form


    This component provides an object-oriented interface for building forms, complete with input filtering and rendering capabilities.


  13. Zend_Gdata (Zend Google Data Client)


    The Google Data APIs provide read/write access to such services hosted at google.com as Spreadsheets, Calendar, Blogger, and CodeSearch.


  14. Zend_Http_Client


    This component provides a client for the HTTP protocol, without requiring any PHP extensions. It drives our web services components.


  15. Zend_Json


    Easily convert PHP structures into JSON and vice-versa for use in AJAX-enabled applications.


  16. Zend_Layout


    Easily provide sitewide layouts for your MVC applications.


  17. Zend_Loader


    Load files, classes, and resources dynamically in your PHP application.


  18. Zend_Locale


    Zend_Locale is the Framework’s answer to the question, “How can the same application be used around the whole world?” This component is the foundation of Zend_Date, Zend_Translate, and others.


  19. Zend_Log


    Log data to the console, flat files, or a database. Its no-frills, simple, procedural API reduces the hassle of logging to one line of code and is perfect for cron jobs and error logs.


  20. Zend_Mail and Zend_Mime


    Almost every Internet application needs to send email. Zend_Mail, assisted by Zend_Mime, creates email messages and sends them.


  21. Zend_Measure


    Using Zend_Measure, you can convert measurements into different units of the same type. They can be added, subtracted, and compared against each other.


  22. Zend_Memory


    Zend_Memory offers an API for managing data in a limited memory mode. A PHP developer can create a Zend_Memory object to store and access large amounts of data, which would exceed the memory usage limits imposed by some PHP environments.


  23. Zend_Pdf


    Portable Document Format (PDF) from Adobe is the de facto standard for cross-platform rich documents. Now, PHP applications can create or read PDF documents on the fly, without the need to call utilities from the shell, depend on PHP extensions, or pay licensing fees. Zend_Pdf can even modify existing PDF documents.


  24. Zend_Registry


    The registry is a container for storing objects and values in the application space. By storing an object or value in the registry, the same object or value is always available throughout your application for the lifetime of the request. This mechanism is often an acceptable alternative to using global variables.


  25. Zend_Rest_Client and Zend_Rest_Server


    REST Web Services use service-specific XML formats. These ad-hoc standards mean that the manner for accessing a REST web service is different for each service. REST web services typically use URL parameters (GET data) or path information for requesting data and POST data for sending data.


  26. Zend_Search_Lucene


    The Apache Lucene engine is a powerful, feature-rich Java search engine that is flexible about document storage and supports many complex query types. Zend_Search_Lucene is a port of this engine written entirely in PHP 5.


  27. Zend_Service: Akismet, Amazon, Audioscrobbler, Delicious, Flickr, Nirvanix, Simpy, StrikeIron and Yahoo!


    Web services are important to the PHP developer creating the next generation of mashups and composite applications. The Zend Framework provides wrappers for service APIs from major providers to make it as simple as possible to use those web services from your PHP application.


  28. Zend_Session


    Zend_Session helps manage and preserve session data across multiple page requests by the same client.


  29. Zend_Translate


    The Zend_Translate component provides the Zend Framework with message translation functionality.


  30. Zend_Uri


    Zend_Uri is a component that aids in manipulating and validating Uniform Resource Identifiers (URIs). Zend_Uri exists primarily to service other components such as Zend_Http_Client but is also useful as a standalone utility.


  31. Zend_XmlRpc


    Zend_XmlRpc makes it easy to communicate with and create XML-RPC services from PHP.

Easy way to data filter and validate in php

Before php 5.2.0 when we have to validate or filter user data, we normally use regex and some php functions. Some of those regex are difficult to understand. So normally most of the coders search in google to collect the correct regex to validate data and also use some php functions to filter data.


In php 5.2.0 a new extension is provided named filter to make these filter tasks much easy.  You can install it in your linux distro by simply typing in shell  pecl install filter


Before proceeding next at first check the available filters in your system:


echo'<pre>';


print_r(filter_list());


echo'</pre>';


Output in my system:


Array


(


    [0] => int


    [1] => boolean


    [2] => float


    [3] => validate_regexp


    [4] => validate_url


    [5] => validate_email


    [6] => validate_ip


    [7] => string


    [8] => stripped


    [9] => encoded


    [10] => special_chars


    [11] => unsafe_raw


    [12] => email


    [13] => url


    [14] => number_int


    [15] => number_float


    [16] => magic_quotes


    [17] => callback


)


filter_list() is a method that returns a list of all supported filters.



Validate Email address


Normally we validate email address like this way


$email= "viral.solani@gmail.com";


if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {


  echo"Valid email address.";


}


else{


  echo"Invalid email address.";


}


But using php’s filter functions you can easily verify that


$email  = "viral.solani@gmail.com";


 if(filter_var($email, FILTER_VALIDATE_EMAIL)){


      echo" $email is valid email address <br />";


 }


 $email= "viral.solani@gmail.com"; 


if(filter_var($email, FILTER_VALIDATE_EMAIL) === FALSE){


      echo" $email is not a valid email address <br />";


 }


Output


viral.solani@gmail.com is valid email address


viral.solani@gmail,com is not a valid email address


So using filter_var() and its parameters you can easily validate email, url, ip address and more.


Check this link to learn what type of data you can validate via filter functions. Normally FILTER_VALIDATE_EMAIL, FILTER_VALIDATE_INT,FILTER_VALIDATE_URL, FILTER_VALIDATE_IP are mostly used.



Data Sanitization


Data sensitization is very important. As a coder never trust user’s input. User may push SQL injection code or javascript code. So always validate or sanitize data before use. To sanitize data you can use the same filter functions but you have to only provide sanitize filters as second parameter. Some commonly used sanitize filters are:



FILTER_SANITIZE_EMAIL
FILTER_SANITIZE_NUMBER_FLOAT
FILTER_SANITIZE_NUMBER_INT
FILTER_SANITIZE_SPECIAL_CHARS
FILTER_SANITIZE_STRING
FILTER_SANITIZE_URL
FILTER_SANITIZE_ENCODED

You’ll see detail list and description from here. For example to get valid string from user input


$userData= array(


               '<b>bold</b>',


               "<script>javascript alert('hi');</script>",


               'P*}i@893746%%%p*.i.*}}|.dw<?php echo "echo works!!";?>'


           );


   $myinputs= filter_var_array($userData, FILTER_SANITIZE_STRING);


   echo'<pre>';


   print_r($myinputs);


   echo'</pre>';


output


Array


(


    [0] => bold


    [1] => javascript alert('hi');


    [2] => P*}i@893746%%%p*.i.*}}|.dw


)


filter_var_array() is used to get multiple variables and optionally filters them. And this function is very useful for retrieving many values without repetitively callingfilter_var().