![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 249 Pomógł: 0 Dołączył: 22.12.2011 Ostrzeżenie: (10%) ![]() ![]() |
Mam taki kod:
Jakim cudem plik configs.inc.php zostaje includowny? Dlaczego się tak dzieje? Przecież wyraźnie jest użyty operator negacji oraz jest to warunek a nie zwykłe include. Ten post edytował MESSIAH :) 13.08.2017, 19:47:50 -------------------- TERA TRYBI.pl
|
|
|
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 6 806 Pomógł: 1828 Dołączył: 11.03.2014 Ostrzeżenie: (0%) ![]() ![]() |
Przecież tą negacją nie negujesz faktu includowania.
-------------------- |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 365 Pomógł: 70 Dołączył: 5.04.2009 Ostrzeżenie: (0%) ![]() ![]() |
Cytat Handling Returns: include returns FALSE on failure and raises a warning. Successful includes, unless overridden by the included file, return 1. It is possible to execute a return statement inside an included file in order to terminate processing in that file and return to the script which called it. Also, it's possible to return values from included files. You can take the value of the include call as you would for a normal function. This is not, however, possible when including remote files unless the output of the remote file has valid PHP start and end tags (as with any local file). You can declare the needed variables within those tags and they will be introduced at whichever point the file was included. Tutaj masz co zwrocic moze include. Ale to niewazne, poniewaz: ! include('inc/configs.inc.php') Mamy tutaj 2 operacje, uzycie operatora negacji oraz wywolanie funkcji. Najpierw wywola sie funkcja - zeby operator negacji mogl byc uzyty na wyniku tej funkcji. Tylko wtedy PHP moze wiedziec czy < ! wywolanie funkcji > ma zwrocic true or false. Wiec, skoro najpierw wykona sie ta funkcja include - mozesz zauwazyc ze twoj kod zawsze zaincluduje ten plik* * moga byc jakies specjalne przypadki dla ktorych to sie nie zaincluduje - naprzyklad jak nie bedzie mozna tego pliku znalezc. |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 15.07.2025 - 12:03 |