WordPress database error: [Table './ay6u3nor6dat6ba1/kn6_ayu1n9k4_5_actionscheduler_actions' is marked as crashed and last (automatic?) repair failed]
SELECT a.action_id FROM kn6_ayu1n9k4_5_actionscheduler_actions a WHERE 1=1 AND a.hook='aioseo_send_usage_data' AND a.status IN ('in-progress') ORDER BY a.scheduled_date_gmt ASC LIMIT 0, 1

WordPress database error: [Table './ay6u3nor6dat6ba1/kn6_ayu1n9k4_5_actionscheduler_actions' is marked as crashed and last (automatic?) repair failed]
SELECT a.action_id FROM kn6_ayu1n9k4_5_actionscheduler_actions a WHERE 1=1 AND a.hook='aioseo_send_usage_data' AND a.status IN ('pending') ORDER BY a.scheduled_date_gmt ASC LIMIT 0, 1

Finding similarity in strings with similar_text | Loop and Break

Finding similarity in strings with similar_text

similar_text calculates the similarity between two strings implementing the World’s Best Algorithms by Oliver (ISBN 0-131-00413-1). Note that this implementation does not use a stack as in Oliver’s pseudo code, but recursive calls which may or may not speed up the whole process. Note also that the complexity of this algorithm is O(N**3) where N is the length of the longest string.

Example

<?php
$firstString = 'this world is very beautiful';
$secondString = 'this world is very beautiful and peoples are too good';

similar_text($firstString, $secondString, $percent);
echo $percent . "<br>";

$secondString = 'are u crazy';

similar_text($firstString,$secondString, $percent);
echo $percent;

?>

Output :

69.135802469136
15.384615384615
Share

You may also like...