Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> 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
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.


--------------------
/maggot/
Go to the top of the page
+Quote Post
BzikOS
post
Post #3





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

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


Aaaaaha. I wszystko jasne.

Dzięki biggrin.gif
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 21.08.2025 - 08:35