Hello Everyone,
I seek for help on this project I am working on
-
The project requires me to explode a string (Usually a large text file) into individual sentences.
-
Pick/Select from the array of sentences only the sentences that have at least a specified number of words. And discard the rest of the array as not useful
-
Search my database for a string where any or as many of the sentences are contained.
-
And then display the result…
[PHP]
//Finished getting string info
//Begin the checking process
$str = trim($row_getPublication[‘postcontent’]); // Initialize string from the Body of the Gotten Publication
array_map(‘trim’,explode(".",$str)); // Explode String
$publication_split = array_map(‘trim’,explode(".",$str)); // assign exploded string to variable
if (isset($row_getPublication[‘account_id’]))
{
$colname2_checkPublication = $row_getPublication[‘account_id’];
}
foreach ($publication_split as $each){
mysql_select_db($database_conNote, $conNote);
$query_checkPublication = sprintf(“SELECT * FROM publications WHERE postcontent LIKE %s AND account_id != %s”, GetSQLValueString("%" . $each . “%”, “text”),GetSQLValueString($colname2_checkPublication, “text”));
}
$checkPublication = mysql_query($query_checkPublication, $conNote) or die(mysql_error());
$row_checkPublication = mysql_fetch_assoc($checkPublication);
$totalRows_checkPublication = mysql_num_rows($checkPublication);
[/PHP]