1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

PHP 定義済み定数 DIRECTORY_SEPARATOR 個人メモ

Last updated at Posted at 2021-07-12

目的

  • 定義済み定数であるDIRECTORY_SEPARATORの存在を初めて知ったのでメモ的にまとめておく

DIRECTORY_SEPARATORは名前通りディレクトリの区切り文字が格納されている定数

  • 下記のように記載して実行してみる。

    echo DIRECTORY_SEPARATOR;
    
  • \が出力された。

  • /が出力された。

  • この定義済み定数はOSによって¥を返したり\を返したりするらしい。

  • この定義済み定数はOSによって/を返したり\を返したりするらしい。

  • linux系環境だと/を、windows環境だと\を返すようだ。

1
0
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?