လက်ရှိတည်နေရာ: ပင်မစာမျက်နှာ> ဖန်ရှင်အမျိုးအစားများ> stream_resolve_include_path

stream_resolve_include_path

ထည့်သွင်းရန်အရဖိုင်အမည်ကိုဖြေရှင်းပါ
အမည်:stream_resolve_include_path
အမျိုးအစား:စီးခေျာင်း
programming language:php
တစ်ကြောင်းဖြင့်အကျဉ်းချုပ်:ဖိုင်များကိုရှာဖွေရန် Commath_pathath တွင်သတ်မှတ်ထားသောလမ်းညွှန်ချက်ကိုဆွေမျိုးလမ်းကြောင်းကိုဖြေရှင်းပြီးရှာဖွေသည်

function name: stream_resolve_intude_path ()

သက်ဆိုင်သောဗားရှင်း: PHP 5> = 5.3.2

function ကိုဖော်ပြချက်: stream_resolve_intude_path () function ကိုမူပကတိလမ်းကြောင်းသို့ actlowative လမ်းကြောင်းကိုဖြေရှင်းပြီး file ကိုရှာရန် compat_thath တွင်ဖော်ပြထားသောလမ်းညွှန်ကိုရှာဖွေသည်။

အသုံးပြုမှု: string stream_resolve_includude_path (string $ filename)

Parametermer

  • $ filename - ခွဲခြမ်းစိတ်ဖြာရန်ဖိုင်လမ်းကြောင်းသည်ဆွေမျိုးသို့မဟုတ်အကြွင်းမဲ့လမ်းကြောင်းလမ်းကြောင်းဖြစ်နိုင်သည်။

Return Value: ဖိုင်တစ်ဖိုင်ကိုရှာပါကဖိုင်ကိုအကြွင်းမဲ့လမ်းခရီးသို့ပြန်သွားသည်။ ဖိုင်မရှိပါက false ကိုပြန်ပို့သည်။

ဥပမာ - ကျွန်ုပ်တို့တွင်အောက်ပါလမ်းညွှန်ဖွဲ့စည်းပုံရှိသည်ဆိုပါစို့။

  • /var/htmml/index.php
  • /Var/www/ininudes/libray.php
 // 示例1:使用相对路径$filename = '../includes/library.php'; $absolutePath = stream_resolve_include_path($filename); if ($absolutePath !== false) { echo "文件的绝对路径为:$absolutePath"; } else { echo "文件未找到"; } // 示例2:使用绝对路径$filename = '/var/www/includes/library.php'; $absolutePath = stream_resolve_include_path($filename); if ($absolutePath !== false) { echo "文件的绝对路径为:$absolutePath"; } else { echo "文件未找到"; }

output ရလဒ် - ဥပမာ 1 - ဖိုင်၏အကြွင်းမဲ့အာဏာလမ်းကြောင်းမှာ --VAR/WWW/ininudes/library/inibray.php ဥပမာ - ဖိုင်၏ပကတိလမ်းကြောင်း - /VAR/WWW/CICLudes/libray.php

သက်ဆိုင်သောဖင်ခှ်ရှင်းများ
လူကြိုက်များသော ဆောင်းပါးများ