Forum Moderators: open
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}&twn=stringForUrl{twn}">{twn}</a>
</span></div>
</li>
</ul>
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;
}
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].