Jump to content

Check if file existes


dandandan

Recommended Posts

slight modification to your code Timbo:

[code=php:0]
<?php
$number="1";
$filename="test";

while(!file_exists($filename.$number.'.txt'))
{
    $number++;
}
?>
[/code]

you forgot the ! in the condition, and a . between your $filename and $number, and also forgot some quotes for the .txt
Link to comment
https://forums.phpfreaks.com/topic/23054-check-if-file-existes/#findComment-104153
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.