unlike asp.net, there is no "code behind" page in php. personally i like it better.
if you want to define functions, just define them at the top of your script, or, in a seperate file and include them later. i'll give you a quick example of the first one.
<?
function my_function(){
$text = "hello world";
}
echo "<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td>". my_function() ."</td>
</tr>
</table>";
?>
alternatively, if all your functions were in a file named "functions.php", then just include them at the top of the file like this:
<?
include("functions.php");
?>
coding php and dreamweaver together is going to be a bit more tricky, .. and coding with zend studio and dreamweaver would be even more tricky.
i'd say, if you must use dreamweaver, then use that to create the layout of your site first. the graphics, menus and such.
at the time, if you want to use zend studio, ditch dreamweaver and start modifying things in zend as you need too.
if you're coding php, you should probably make it a priority to understand how to code/modify html without dreamweaver.
not a flame in anyway, just my advice.
good luck.