I would like to update space to hyphen in my php url file via get method. I have tried some methods, but i got an error.
For an example,
the original url is pindtrict.php?ste=Tamil Nadu
i want optimized url as, pindtrict.php?ste=Tamil-Nadu
How to do this? Here it is my code,
<?php
include(config.php');
$state_content= "";
$qry = "SELECT DISTINCT State_N FROM pin_data ORDER BY State_N ASC";
$result = mysql_query($qry);
while($row = mysql_fetch_array($result))
{
$state_content .= "<li><a href='pindtrict.php?ste=".$row['State_N']."'> ".$row['State_N']."</a></li>";
}
mysql_close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Pincode Directory</title>
<body>
<div>
<?php echo $state_content; ?><br />
</div>
</body>
</html>