Search
 
SCRIPT & CODE EXAMPLE
 

PHP

check directory exists in php

<?php
$directory = "./videos/category/";
if (!file_exists($directory)) {
  mkdir($directory, 0777, true);
}
?>
Comment

php directory exists

$directory = "/var/www/videos/";
if (file_exists($directory) && is_dir($directory))
{
  echo "Sure, exists and is dir";
}else{
  echo "Not exists. Creating...";
  mkdir($directory, 0777, true);
}
Comment

php check if folder exists


<?php
$filename = '/path/to/foo.txt';

if (file_exists($filename)) {
    echo "The file $filename exists";
} else {
    echo "The file $filename does not exist";
}
?>

Comment

PREVIOUS NEXT
Code Example
Php :: get all post values in php 
Php :: select join distinct 
Php :: how to get previous page name in php 
Php :: url encode php 
Php :: guzzle bearer token 
Php :: php remove last element array 
Php :: php set timezone italy 
Php :: carbon diffForHumans 
Php :: set nav link active on the basis of route laravel 8 
Php :: wpml get current language filter 
Php :: laravel check if object empty 
Php :: A table was not found You might have forgotten to run your migrations. You can run your migrations using php artisan migrate. Pressing the button below will try to run your migrations. 
Php :: get last 30 days records in laravel 
Php :: is number divisible by 3 php 
Php :: php check if non-object 
Php :: php mkdir if not exists 
Php :: laravel insert 
Php :: php mysqli connection check 
Php :: laravel collection flatten 
Php :: how to use join query in codeigniter 
Php :: php date and time 
Php :: How to Get the last element of an array in PHP – end() 
Php :: laravel getbindings 
Php :: upload file in wp from url 
Php :: laravel updateorcreate 
Php :: The mysqli extension is missing. Please check your PHP configuration. 
Php :: php sql connection string 
Php :: cakephp 404 exception 
Php :: php redirect if not logged in 
Php :: check if array has value php 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =