Hi Ray
Many thanks. We're at the limit of my knowledge here! Where do I name the 'test' part? echo create_slug("".$rsPg->getColumnVal("pg_slug")."")."";
I move the slug code between the recordset and the update behaviour:
<?php
function create_slug($string, $charset = 'utf-8'){
$string = htmlentities($string, ENT_NOQUOTES, $charset, false); // convert accented characters to entities
// strip unwanted parts of entities to leave unaccented character
$string = preg_replace('~&([A-za-z])(?:acute|cedil|caron|circ|grave|orn|ring|slash|th|tilde|uml);~', '\1', $string);
$string = preg_replace('~&([A-za-z]{2})(?:lig);~', '\1', $string);
$string = preg_replace('~&[^;]+;~', '', $string); // remove other entities
return preg_replace('~[\s!*\'();:£@&=+$,/?%#[\]]+~', '-', $string); // replace spaces and illegal characters with hyphens
}
echo create_slug("".$rsPg->getColumnVal("pg_slug")."")."";
?>
Cheers
Chris