<?php
$varray = $database->getProfileVillages($session->uid);
for($i=0;$i<=count($varray)-1;$i++) {
echo "<tr><th>Köy ismi</th><td><input tabindex=\"6\" type=\"text\" name=\"dname$i\" value=\"".$varray[$i]['name']."\" maxlength=\"20\" class=\"text\"></td></tr>";
}
?>
<tr><td colspan="2" class="desc2"><textarea tabindex="8" name="be2"><?php echo $session->userinfo['desc1']; ?></textarea></td></tr>
I want that if user enters ” ” (space) then system changes it to – (hiphen).
Example
(“Soul Man” becomes “Soul-Man”) & (” ” becomes “-“).
Can you replace code to my code please?
Thanks in advance
Use
str_replace()When giving
echo, give this:Where
$stris the string, in which you wanna replace the spaces to dashes.Replace:
With:
Copy paste this code: