I want to use the variable used in the title for the url, what I need is to count spaces and make them be dashes on the url, for example: Title is: How to make this Url should be: how-to-make-this.html How is it done? Thanks!
$url = ereg_replace(" ","-",$title).".html"; What this does is searches for " " or spaces in $title, and changes them into a - So say $title='How to make this'; $url = ereg_replace(" ","-",$title).".html"; print $url; Code (markup): Should output How-to-make-this.html If you want to learn more, read this http://us3.php.net/manual/en/function.ereg-replace.php
also this could help <?php echo stripslashes(str_replace('+', '-', urlencode($title)));?> then in htaccess rewriteEngine on rewriteRule ^(.+)Article([0-9]+)\.html(/)?$ articleDetail.php?id=$2&title=$1 rewriteRule ^(.+)\.html(/)?$ $1.php Not sure if this will work , need a lot of tests for those things before it works ....