FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Disable a button when clicked





Denvis
I've made a hangman game and I want to make it so that once a letter is clicked, after the checking if the letter is in the word, disable it. Is there a PHP function that allows that?
Nemesis234
there is no function is php for doing this, javascript is only thing i know which will work

http://www.webreference.com/js/tips/020201.html
Denvis
Okay, how about... is there a function in PHP that tells you how many of the same characters are there within a string?
Nemesis234
Quote:
Example #1 count_chars() example
Code:
<?php
$data = "Two Ts and one F.";

foreach (count_chars($data, 1) as $i => $val) {
   echo "There were $val instance(s) of \"" , chr($i) , "\" in the string.\n";
}
?>

The above example will output:
There were 4 instance(s) of " " in the string.
There were 1 instance(s) of "." in the string.
There were 1 instance(s) of "F" in the string.
There were 2 instance(s) of "T" in the string.
There were 1 instance(s) of "a" in the string.
There were 1 instance(s) of "d" in the string.
There were 1 instance(s) of "e" in the string.
There were 2 instance(s) of "n" in the string.
There were 2 instance(s) of "o" in the string.
There were 1 instance(s) of "s" in the string.
There were 1 instance(s) of "w" in the string.
Related topics
To rainbox or not to rainbox?
JS Disable Button.
Minimize Frame Button
How to expired a page so a user cannot press back button ?
How can I disable the back button of my browser?
Disabling a textbox on click of a radio button
Input Button's - Internet Explorer
constant menus
Making some part of the form inactive/hidden
Disable Right Click On ANy Browser
Compose an algorithm to disable a button?
'Page' Button. (A variant of reply notification.)
Automatic disable of replies?
A THIRD man has died after drinking home-brewed spirits
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.