Jump to content

if number = (Number) help


jnerotrix

Recommended Posts

Heres The Code I Have

 

<?php

$ip = $_SERVER['REMOTE_ADDR']; //Checks Ip

$myFile = "ip.txt"; 

$lines = file($myFile); 
$lines = array_map('trim',$lines);

if(!in_array($ip,$lines)){
   $fh = fopen($myFile, 'a') or die("can't open file");
   $stringData = "$ip\r\n";
   fwrite($fh, $stringData);
   fclose($fh);
}

$file = "ip.txt";
  $users = count(file($file));
  echo "We Have Had $users users Visit This Site";
?>

 

I need it so - - -  if $users = 1000 then do command else do other command

 

so it would look like this i just dont know how to code it

<?php

if ($users equals 1000 {
echo "you are the 1000 User To Visit this Site";

} else {
echo "Welcome to My Website";
}
?>

 

Link to comment
https://forums.phpfreaks.com/topic/141632-if-number-number-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.