إكتب نص من أجل أن يتم تصحيحه, مثال: أريد من البعظ بذل بعظ الوقت على الآخرين


<?php
    
    
if(isset($_POST['words'])) {
        
$lines file('arabic.acl');
        
$words $_POST['words'];
        foreach(
$lines as $line) {
            
$word explode("\t",$line);
            
$words str_replace(' '.$word[0].' '' <font color="red">'.trim($word[1]).'</font> '$words);
        }
    }
?>
<!DOCTYPE html>
<html>
<head>
    <title>Ghalatawi</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<style>
    body{
        margin:20px;
         font-family: Arial;
         font-size: 18px;
        }
</style>
<body dir="rtl">
    إكتب نص من أجل أن يتم تصحيحه, مثال: أريد من البعظ بذل بعظ الوقت على الآخرين
    <hr>
<form method="POST">
    <div style="font-size: 18px; font-family: Arial;"><?=nl2br($words)?></div>
    <textarea name="words" style="font-size: 18px; width: 600px; height: 150px;"><?=$_POST['words']?></textarea> <br />
    <input type="submit">
</form>
</body>
</html>
<?print '<hr><div style="direction:ltr">';highlight_file(__FILE__).'</div>';?>