Hướng dẫn php create folder w3schools

❮ PHP Filesystem Reference

Example

Create a directory named "test":


Definition and Usage

The mkdir[] function creates a directory specified by a pathname.

Syntax

mkdir[path, mode, recursive, context]

Parameter Values

ParameterDescription
path Required. Specifies the directory path to create
mode Optional. Specifies permissions. By default, the mode is 0777 [widest possible access].

Note: The mode parameters is ignored on Windows platforms!

The mode parameter consists of four numbers:

  • The first number is always zero
  • The second number specifies permissions for the owner
  • The third number specifies permissions for the owner's user group
  • The fourth number specifies permissions for everybody else

Possible values [to set multiple permissions, add up the following numbers]:

  • 1 = execute permissions
  • 2 = write permissions
  • 4 = read permissions
recursive Optional. Specifies if the recursive mode is set [added in PHP 5]
context Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream [added in PHP 5]

Technical Details

Return Value:PHP Version:
TRUE on success, FALSE on failure
4.0+

❮ PHP Filesystem Reference


Learn PHP

PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.

PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.

Start learning PHP now »

Easy Learning with "PHP Tryit"

With our online "PHP Tryit" editor, you can edit the PHP code, and click on a button to view the result.

Example




Try it Yourself »

Click on the "Try it Yourself" button to see how it works.

PHP Exercises

PHP Examples

Learn by examples! This tutorial supplements all explanations with clarifying examples.

See All PHP Examples

PHP Quiz Test

Learn by taking a quiz! This quiz will give you a signal of how much you know, or do not know, about PHP.

Start PHP Quiz!

My Learning

Track your progress with the free "My Learning" program here at W3Schools.

Log into your account, and start earning points!

This is an optional feature. You can study W3Schools without using My Learning.

PHP References

W3Schools' PHP reference contains different categories of all PHP functions, keywords and constants, along with examples.


Kickstart your career

Get certified by completing the course

Get certified

w3schoolsCERTIFIED.2022



Hướng dẫn python all[] function

Function [hay còn gọi là Hàm]: Là một khối lệnh được đóng gói lại thành một đơn vị độc lập, dùng để thực hiện một tác vụ trong chương trình. Hàm ...

Hướng dẫn dùng php website trong PHP

Code PHP web hoàn chỉnh từ A-Z trong 5h | Lập trình PHPPHP – viết tắt hồi quy của “Hypertext Preprocessor”, là một ngôn ngữ lập trình kịch bản được chạy ở ...

Python minidom modify xml file

Since 8 hours Im now trying to parse a XML and add 5 lines of text into the xml. Im making really no progress and neither writexml, toxml nor saveXML seems to work from the minidom libWe want to ...

Hướng dẫn path trong html

bởi Nguyễn Văn Hợi vào 02/06/2019. Lượt xem: 4,651 Đường dẫn Mô tả

Chủ Đề