Consider looking at the PHP Documentation. PHP has AWESOME docs, and the code that you would use in the Blackberry browser is the same as the code that you would use on a desktop browser. Simply writing your application with desktop support would be sufficient, then all you need to do is style your app with something like CSS to look good on the tiny Blackberry screen.
As for a Hello World example, consider this code:
<?php
echo strip_tags($_REQUEST["foo"]);
Making the following request to this script:
http://example.com/whatever/the_script.php?foo=bar
would output bar
in the browser. Changing bar
in the request will change the output to the browser.
Hope this helps!