k7l2010 Posted May 13, 2020 Share Posted May 13, 2020 (edited) مرحبا من فضلك مساعدة ماذا يفتقر هذا الرمز للعمل؟ مطلوب عدم تكرار الحقل في ملف نصي يرجى تعديل الكود <?php if(isset($_POST['send'])){ $b1 = $_POST['b1']; $b2 = $_POST['b2']; $file = fopen("xm.txt", "a+"); for($i = 0; $i < count($file); $i++){ $read = explode("||" ,$file[$i]); if($read[0] == $b1 ){ echo 'Duplicate'; } else { fwrite($random_file,$b1.'||'.$b2."\r\n"); fclose($random_file); } } } ?> Edited May 13, 2020 by k7l2010 Link to comment Share on other sites More sharing options...
Barand Posted May 13, 2020 Share Posted May 13, 2020 1 ) This is an English-speaking forum. 2 ) You have already posted this same question before and had replies. Don't double-post. Link to comment Share on other sites More sharing options...
Recommended Posts