Jump to content

[SOLVED] Replacing spaces?


nesiak

Recommended Posts

I've made this function to replace spaces with "-" and it doesn't work :( what did i do wrong?

 

<?php
$string = "Go for it now";
echo $string;
function change($str)
{
while ($a!=strlen($str));
{ 
  $ss =fgetc($file);
if ($ss==" ") 
{
  $ss = "-";
}
  $ok = $ok+$ss; 
  $a++;
  echo $ok;
  echo $a;
}
}
change($string);
?>

Link to comment
https://forums.phpfreaks.com/topic/52692-solved-replacing-spaces/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.