Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> include a require
BzikOS
post
Post #1





Grupa: Przyjaciele php.pl
Postów: 660
Pomógł: 0
Dołączył: 28.08.2002
Skąd: Starachowice

Ostrzeżenie: (0%)
-----


Jaka jest róznica między include, include_once, require, require_once?

Wiem tyle, że include to funkcja php, a require to kostrukcja językowa i że require nie zwraca wartości, ale prosiłbym o jakiś przykład praktycznego wykorzystania obu funkcji. Do czego stosować include, a do czego require (no i te _once).
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
maggot
post
Post #2





Grupa: Zarejestrowani
Postów: 77
Pomógł: 0
Dołączył: 7.05.2002
Skąd: Sz-n/Wroc/Wawa

Ostrzeżenie: (0%)
-----


The require() statement includes and evaluates the specific file.
dolacza i wykonuje podany plik

require() and include() are identical in every way except how they handle failure. include() produces a Warning while require() results in a Fatal Error.

czyli jesli bedzie blad przy include to wyrzuci blad i skrypt bedzie sie wykonywal dalej, jesli blad bedzie przy require to wyrzuci blad i zatrzyma skrypt

The include_once() statement includes and evaluates the specified file during the execution of the script. This is a behavior similar to the include() statement, with the only difference being that if the code from a file has already been included, it will not be included again. As the name suggests, it will be included just once.
Go to the top of the page
+Quote Post

Posty w temacie
- BzikOS   include a require   7.10.2002, 11:20:00
- - maggot   The require() statement includes and evaluates the...   7.10.2002, 11:49:43
- - BzikOS   Aaaaaha. I wszystko jasne. Dzięki   9.10.2002, 08:19:42


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 2.10.2025 - 18:51