Welcome to WebmasterWorld Guest from

Forum Moderators: httpwebwitch

Message Too Old, No Replies


10:20 pm on Aug 8, 2007 (gmt 0)

Junior Member

5+ Year Member

joined:Aug 1, 2007
votes: 0

Hopefully I'm posting in the right place

I have already had my PHP answer for SEF Urls
just need to slolve the same issue for XML Spry framework

<ul spry:region="dsTowns" spry:repeatchildren="dsTowns">
<li onclick="stringForUrl" spry:select="selected" spry:hover="hover">
<div align="center"><span class="mainlevel2">
<a href="dining2.php?county={county}&amp;twn=stringForUrl{twn}">{twn}</a>

I am trying to call the folloing function stringForUrl via xml infact any link on the entire site with spaces in needs to call this function

any one any idea's?

function stringForUrl($strIn) {
$strOut = '';
$allowed = '/[^a-zA-Z0-9 ]/';
$strOut = $strIn;

// only alphanum and spaces allowed
$strOut = preg_replace($allowed, '', $strOut);

// swap spaces for _
$strOut = str_replace(' ', '_', $strOut);
$strOut = trim($strOut);

// make lower case for consistancy
$strOut = strtolower($strOut);

return $strOut;

3:15 pm on Aug 9, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 21, 2005
votes: 0

I can't answer your question, but I hate to see posts languish without at least a ping.

I'm unfamiliar with the XML framework you are using, so I can't answer the question.

I know how to do PHP callouts in XSLTProcessor [us2.php.net].