-
Posts
2 -
Joined
-
Last visited
Posts posted by k7l2010
-
-
Please help and amend the code Save without repetition required $read[0] I hope that my example is clear to you I apologize for bothering you. I am not good in English
<?php $fileLocation = getenv("DOCUMENT_ROOT") . "/rt.txt"; $file = fopen($fileLocation,"a"); $n1 = $_POST['n1']; $n2 = $_POST['n2']; for($i = 0; $i < count($file); $i++){ $read = explode("|", $file[$i]); if($n1 == $read[0]){ echo 'Repetition'; } else { fwrite($file,$n1.'|'.$n2."\r\n"); }
Please help in modifying the code
in PHP Coding Help
Posted · Edited by k7l2010
مرحبا من فضلك مساعدة ماذا يفتقر هذا الرمز للعمل؟ مطلوب عدم تكرار الحقل في ملف نصي يرجى تعديل الكود