Jump to content

mehidy1437

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by mehidy1437

  1. Thanks for your response. $name is containing the string mehidy from the input & it's showing/printing fine. So, i just want to count the number of character in $name. If i can use the $name to print the string/input value then it should be possible to count the string length also, am I wrong here?
  2. Hello guys, Please see below function, so far everything is good. But when I input Mehidy in input box, it's echo $name; it shows Mehidy, which is okay. But when I echo strlen($name); it shows 65 i/o 6 It's show the number of characters of $answer = "<script type='text/javascript'> document.write(answer); </script>"; why is it so? How can I get the real strlen of Mehidy? Please help. //prompt function function prompt($prompt_msg){ echo("<script type='text/javascript'> var answer = prompt('".$prompt_msg."'); </script>"); $answer = "<script type='text/javascript'> document.write(answer); </script>"; return($answer); } //program $prompt_msg = "Please type your name."; $name = prompt($prompt_msg); echo $name; echo strlen($name);
×
×
  • 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.