Extract is your friend. Ever been in the situation where you need to say something like:
<?php $name = $array['name']; $surname = $array['surname']; $message = $array['message'];Then you may want to recall that you can use extract() to do the same.
Put simply, extract will remove the work behind this.
In this case, saying:
<?php extract($array);Will automatically make $name = $array['name'];
So, you can say "hello ".$name." ".$surname." Without do all of the declarations.
Of course, you always need to be mindful of validation and filtering, but there is a right way and a wrong way to do anything with PHP.
thanks this is help full
ReplyDeleteAwesome tricks
ReplyDeleteit company in Bhopal in Bhopal