FAQ |
Kalender |
![]() |
#1 | ||
|
|||
Klarade millennium-buggen
|
Vad är skillnaden på funktionerna include_once() och require_once() i php?
|
||
![]() |
![]() |
![]() |
#2 | ||
|
|||
Mycket flitig postare
|
om require_once inte hittar filen så avslutas php-skriptet. Om include_once inte hittar filen så fortsätter php-skriptet. Har jag för mig i alla fall.
|
||
![]() |
![]() |
![]() |
#3 | |||
|
||||
Mycket flitig postare
|
Unlike include(), require() will always read in the target file, even if the line it's on never executes. If you want to conditionally include a file, use include(). The conditional statement won't affect the require(). However, if the line on which the require() occurs is not executed, neither will any of the code in the target file be executed.
|
|||
![]() |
![]() |
![]() |
#4 | |||
|
||||
Mycket flitig postare
|
Hur ofta använder man include_once() och require_once() istället för include() och require() tro? Har aldrig använt förstnämnda faktiskt.
|
|||
![]() |
![]() |
![]() |
#5 | |||
|
||||
Har WN som tidsfördriv
|
Citat:
|
|||
![]() |
![]() |
![]() |
#6 | |||
|
||||
Medlem
|
Citat:
t.ex databas inloggning... |
|||
![]() |
![]() |
![]() |
#7 | |||
|
||||
Mycket flitig postare
|
Citat:
|
|||
![]() |
![]() |
![]() |
#8 | |||
|
||||
Mycket flitig postare
|
Många om budet tycker jag
![]() |
|||
![]() |
![]() |
![]() |
#9 | |||
|
||||
Mycket flitig postare
|
Citat:
Däremot kan man ju gott använda require eller include för header- eller footerdelar av sidan som mest innehåller html och kanske ska förekomma flera om gångar på sidan (require t ex för en header som måste vara med för att innehållet på sidan ska bli meningsfullt, include för någon spalt på sidan som inte absolut måste vara med – require ger resulterar ju annars i att sidan slutar ladda). |
|||
![]() |
![]() |
![]() |
#10 | ||||
|
|||||
Har WN som tidsfördriv
|
Citat:
Citat:
|
||||
![]() |
![]() |
Svara |
|
|