Create a file hello.php, save it in your Drupal root directory, then open your terminal, like Cygwin(If you are on windows). Then navigate to your Drupal root directory where all your projects are located:
Once you are there do this:
drush scr ./hello.php
When you execute your php script, it will print
The hello.php script should be something like:
echo "Hello World!";
You do not need to close your php script with
?>. Drush closes it automatically for you.
Having a good knowledge of Php is important, from here you can write advance scripts to maintain your Dupal projects with ease and do jobs that require little of your time.
This was just a demonstration to show you how to run a php script with Drush.