Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. <?php
  2. function issetFilmId($films_id){
  3. $handle = fopen("val.txt", "r");
  4. if ($handle) {
  5. while (($line = fgets($handle)) !== false) {
  6. if($line == $films_id){
  7. return TRUE;
  8. }
  9. }
  10. fclose($handle);
  11. } else {
  12. return FALSE;
  13. }
  14. }
  15.  
  16. if (issetFilmId(10)) {
  17. echo "Exist";
  18. }
  19. else {
  20. echo("Not exist");
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement