error, str_word_count call to undefined function..
the form:
<form action="convert.php" method="post">
message:
<textarea name="textarea" cols="35" rows="6" id="textarea"></textarea>
<input name="submit" type="submit" value="Submit">
</form>
the converter page:
<!-- database connect, functions -->
<? session_start();
include("./config.php");
include("./dbax.php");
include("./common.php");
?>
<!-- database connect, functions -->
<!-- the code -->
<? $textarea = 'generate hibernate regulate';
$words = array_unique(str_word_count($textarea, 1));
sort($words);
foreach ($words as $value) {$words_quotes[] = "'" . $value . "'";}
$result = mysql_query('SELECT * FROM words WHERE full IN(' . implode(',', $words_quotes) . ') ORDER BY full') or exit(mysql_error());
while ($row = mysql_fetch_assoc($result)) {$words_short[] = $row['short'];}
$textarea = str_replace($words, $words_short, $textarea);
?>
<!-- the code -->
structure for database:
# structure for database `sms`
# Table structure for table `srt`
#
CREATE TABLE srt (
catid int(10) unsigned NOT NULL default '0',
cut text NOT NULL,
full text NOT NULL
) TYPE=MyISAM;
#
# Dumping data for table `srt`
#
INSERT INTO srt VALUES (1, 'a3', 'anytime, anywhere, anyplace');
INSERT INTO srt VALUES (1, 'aam', 'as a matter of fact');
INSERT INTO srt VALUES (1, 'aamof', 'as a matter of fact');
INSERT INTO srt VALUES (1, 'ab', 'ah bless!');
INSERT INTO srt VALUES (1, 'activ8', 'activate');
INSERT INTO srt VALUES (1, 'adctd2luv', 'addicted to love');
INSERT INTO srt VALUES (1, 'add', 'address');
INSERT INTO srt VALUES (1, 'adn', 'any day now');
INSERT INTO srt VALUES (1, 'afaik', 'as far as I know');