Simple WSDL browser

I wasn't able to find a simple and free (as in free beer) WSDL browser. Searching with Google turned into hundreds of results, but these were either .NET applications (and I didn't play with Mono yet and need this for my Linux machine), or commercial, or no longer existant. So I wrote my own one in 40 lines (including HTML and pretty formatting).

My requirements were pretty low: I wanted to pass a WSDL url to it and get back an interface that shows all methods and complex types, cross referenced. This is what I've come up with. It's incomplete (I don't filter out all XSD types yet), has pretty unreadable regular expressions, and lacks any eye candy. But it works for my purpose, and perhaps anybody else's.

This server isn't running PHP 5 unfortunately, which is required, so I can't provide a live demo.

[Update: the browser and the source are available online now.]

<?php
$url 
'http://www.example.com?wsdl';
$client = new SoapClient($url,
                         array(
'trace' => true,
'encoding' => 'iso-8859-1'));

$label '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*';
$func_regexp '/\b(?<!\$)(' $label ')(?!\()\b/';
$func_replace '<a href="#$1">$1</a>';
$type_regexp = array('/struct (' $label ') {/',
'/^ (boolean|int|string)/m',
'/^ (' $label ')(.*)$/m',
'/\0/',
'/^ /m',
'/\n/');
$type_replace = array('struct <a name="$1">$1</a> {',
" \0\$1",
' <a href="#$1">$1</a>$2',
'',
'&nbsp;&nbsp;&nbsp;&nbsp;',
"<br />\n")
?>
<html>
<head></head>
<body>

<h2>Functions</h2>
<?php foreach ($client->__getFunctions() as $func): ?>
<p><?php echo preg_replace($func_regexp$func_replace$func?></p>
<?php endforeach; ?>

<h2>Types</h2>
<?php foreach ($client->__getTypes() as $type): ?>
<p>
<?php echo preg_replace($type_regexp$type_replace$type?>
</p>
<?php endforeach; ?>

</body>
</html>