0
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 5 years have passed since last update.

絶対パスと相対パスどっちがいいの?

0
Posted at

戒めも

絶対パスと相対パスどっちがいいの

絶対パス

なんで絶対パスがいいの?

  • 相対パスにすると、開いた場所からの相対パスになるので、ファイルがうまく読み込めない時がある
  • 相対パスにすると、../../の記述が増えてしまい、煩雑

絶対パスの書き方

PHP: dirname - Manual
↑を使う。

また、一定のパスまで省略させるには、php.iniのinclude_pathの設定をいじる。

0
0
0

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
0
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?