I'm trying to get the value from this HTML input tag :
<form name="form" action="" method="post">
<input name="search" id="search" type="text" class="typeahead" />
</form>
and SpellCorrector::correct function in the following PHP get the value as a string, because it's only accept value from a string type :
<?php
$box = $_POST("search");
include 'SpellCorrector.php';
$correct = SpellCorrector::correct($box);
echo $correct;
?>
The code above isn't working, so I guess I should find a way to convert the $box variable into string type but I don't know how to. Or maybe there's a better solution for my problem.
I'm using this for SpellCorrector.php file