Thursday, January 29, 2009

Include vs Include_Once and Require vs Require_Once - PHP

Include()

The include function simply includes a file, and that is all. If the file isn't found a warning is raised, but the script will continue to execute.

Require()

Require has very similar functionality to include(). However, if a file is not found a warning will be raised and the script will halt completely.

Include_Once() and Require_Once()

You should use these functions if you do not want to include a file multiple times (which can cause errors with functions and classes).

e.g.

file1.php includes file2.php and file3.php.
file2.php also includes file3.php

Without the _once() functions file3 will be included twice, but with the _once() function it will only be included once.

source : http://www.nusuni.com/blog/2007/02/14/php-tip-include-vs-include_once-and-require-vs-require_once/

28 comments:

pk_trial said...
This comment has been removed by the author.
Anonymous said...

Thank you very much. This is the best explanation I've found on the net ever.

Anonymous said...

онлайн порно молодая http://free-3x.com/ скачать школьница порно фильм 2 free-3x.com/ порно студенческое онлайн [url=http://free-3x.com/]free-3x.com[/url]

benza said...

All these are beyond me --- However have feeling many are being helped.

Anonymous said...

[url=http://www.kfarbair.com][img]http://www.kfarbair.com/_images/logo.png[/img][/url]

מלון [url=http://www.kfarbair.com]כפר בעיר[/url] - [url=http://www.kfarbair.com/about.html]חדרים[/url] גדולים אנחנו מספקים שירותי אירוח מיוחדים כמו כן ישנו במקום שירות חדרים המכיל [url=http://www.kfarbair.com/eng/index.html]אחרוחות רומנטיות[/url] במחירים מיוחדים אשר מוגשות ישירות לחדרכם!

לפרטים נא לפנות לעמוד המלון - [url=http://kfarbair.com]כפר בעיר[/url] [url=http://www.kfarbair.com/contact.html][img]http://www.kfarbair.com/_images/apixel.gif[/img][/url]

Anonymous said...

[color=#336699]
Приветик! мм.. есть cупер мысль по[url=http://www.pi7.ru] видео[/url] порталу Думаю вам понравится

[url=http://www.pi7.ru]лизните у меня клитор [/url]
aнекдот для разнообразия :)

Встреачются две однокурсницу вскоре псоле выпусвка. Первая:
- Я на рабгту устроилась. АМ ты?
- Я прденазначена только дл любви! Работа не для меняч!!
- Ну иди по спекциальности.

Я 5 часов блуждалас по сети, пока не вышела на ваш форум! уДмаю, я здесь останусь надолго!
прошу прощения за опечатки.... очень маленьлкая клавиатура у PDA!

[/color]

Anonymous said...

united kingdom singles [url=http://loveepicentre.com/]dating advice[/url] black dating sites http://loveepicentre.com/ the complete motown singles collection

Anonymous said...

auto dvd player portable [url=http://www.cardvdplanet.com/12-inch-desktop-tft-lcd-touchscreen-with-vga--discount-price85.html]auto audio chesapeake virginia[/url] beststuff fuel car dvd ipod vacation houseboat lake http://www.cardvdplanet.com/magoten-touch-screen-7-inch-2-din-tft-lcd--discount-price88.html d mercedes benz reviews auto extended warranty car audio and
auto dvd [url=http://www.cardvdplanet.com/buy-cheap-car-dvd2.html]auto audio wiring kits[/url] honda car audio code how to enter http://www.cardvdplanet.com/car-dvd-player-with-bluetooth-and-tv--discount-price42.html dual screen auto dvd player
auto dvd [url=http://www.cardvdplanet.com/7-0-inch-tft-lcd-displayer-tv-tuner-game--discount-price9.html]oem car audio ford taurus[/url] hyundai car audio system http://www.cardvdplanet.com/car-cd-mp3-player-with-usb-sd-mmc-cd146--discount-price53.html compatible wireless headphones for all auto dvd systems

Anonymous said...

http://blownwhistle.com/forum/viewtopic.php?f=3&t=142294 http://www.gatortorrents.com/smf/index.php?topic=242784.new#new http://www.votetofinespammers.com/phpBB3/viewtopic.php?f=2&t=228426 http://pflegekinder-hamburg.tempd7.internet1.de/forum/viewtopic.php?p=328888#328888
http://www.corneliacharlotte.com/forum/viewtopic.php?f=2&t=214325 http://www.amgineriddles.com/forums/viewtopic.php?f=2&t=42192 http://tengokunf.net63.net/foro/viewtopic.php?f=24&t=3558 http://www.poetrybox.com/dxgold/script/phpBB2/viewtopic.php?p=712317#712317
http://letoya-network.com/forum/viewtopic.php?f=2&t=143585 http://tarassiouk.com/forumkredit/viewtopic.php?f=2&t=70508 http://www.sflstudio.com/phpbb2/viewtopic.php?p=101739#101739

Anonymous said...

http://www.blackviolin.net/forum/viewtopic.php?f=5&t=311456 http://fitzysite.com/forum/viewtopic.php?p=7208#7208 http://foros.snclip.com/showthread.php?p=318702#post318702 http://www.richtwins.com/forum/viewtopic.php?f=38&t=319633
http://www.kiaikyusho.com/foro/viewtopic.php?f=13&t=274 http://discussions.gamingoutpost.com/index.php?showtopic=81629 http://show.kir.jp/cgi-bin/bbs01/apeboard_plus.cgi?command=read_message&msgnum=410 http://www.sanctuarylakes.net/forum/viewtopic.php?f=3&t=260658
http://r638-2.cs.nthu.edu.tw/phpbb2/viewtopic.php?p=102122#102122 http://www.suanrath.com/webboard/index.php?topic=61740.new#new http://seminarfuncruise.com/forum/index.php?topic=200704.new#new

Anonymous said...

tekno medical in germany [url=http://usadrugstoretoday.com/products/avandia.htm]avandia[/url] effects of vitamin and mineral dificientcies http://usadrugstoretoday.com/products/aciclovir.htm about drug education http://usadrugstoretoday.com/categories/artrite.htm
the goods and bads of pharmacy testing [url=http://usadrugstoretoday.com/catalogue/p.htm]Buy generic and brand medications[/url] muscle female search [url=http://usadrugstoretoday.com/products/cystone.htm]chesapeake bay tea light holder[/url]

Anonymous said...

http://meen.in/fexofenadine/fexofenadine-and-pseudoephedrine-systemic
[url=http://meen.in/fluvoxamine/focus-fluvoxamine]tadalafil cialis from india[/url] cancer cure drug [url=http://meen.in/celecoxib/celecoxib-100mg]celecoxib 100mg[/url]
npi for cvs pharmacy http://meen.in/esomeprazole/aciphex-esomeprazole-gerd-lansoprazole-nexium-omeprazole
[url=http://meen.in/fluconazole/fluconazole-sore-tongue]lists of pharmacy benefit managers[/url] health district [url=http://meen.in/cefpodoxime]cefpodoxime[/url]
lethbridge drug screening http://meen.in/claritin/claritin-clarinex-together
[url=http://meen.in/cleocin/is-cleocin-penicillian]holloween drug free bulletin board[/url] cialis sales [url=http://meen.in/erection/erection-in-front-of-mom]erection in front of mom[/url] new caccine for drug adiction [url=http://meen.in/cardizem/cardizem-sa]cardizem sa[/url]

Anonymous said...

deauville fashions http://topcitystyle.com/s-casual-fall-spring-size10.html teaching kids to tie their shoes [url=http://topcitystyle.com/richmond-v-neck-brand18.html]revealing fashions[/url] bjorn shoes
http://topcitystyle.com/dark-blue-dress-shirts-color11.html designer colthing [url=http://topcitystyle.com/-sport-zip-jacket-and-pants-on-sale-category4.html]tv chanel for videos[/url]

Anonymous said...

travel employment calgary http://adventurecollection.in/cruises/cheap-cruises-from-southampton insulated travel cup
[url=http://adventurecollection.in/tourist/maine-tourist-attractions-greenwood]travel get away[/url] duma russian federation travel rules for citizens [url=http://adventurecollection.in/travel]travel[/url]
travel online http://adventurecollection.in/expedia/expedia-corporate-travel-ect-business-customer
[url=http://adventurecollection.in/inn/best-western-inn-at-towanmencin]travel forum dubai[/url] discount discount cheap free world travel [url=http://adventurecollection.in/airlines/bae-missile-american-airlines-bush-carlyle]bae missile american airlines bush carlyle[/url]
travel safe london http://adventurecollection.in/tour/primetime-tour-rutgers air travel stories [url=http://adventurecollection.in/tourist]tourist[/url]

Anonymous said...

porn pics of ozzies family http://theporncollection.in/porn-dvd/underage-rape-porn
[url=http://theporncollection.in/hentai-porn/hentai-kiddy-grade]free adult videosvideos[/url] hentai bleach doujins [url=http://theporncollection.in/moms/moms-undress-movies]moms undress movies[/url]
dildo pussy penetration http://theporncollection.in/porn-galleries/figure-skater-turned-porn-star
[url=http://theporncollection.in/lesbian-sex/free-asia-carrera-lesbian-videos]video sexy manaudou[/url] laser treatment for anal fissures [url=http://theporncollection.in/gay-porn/gay-males-interacting]gay males interacting[/url]
lesbain hentai free http://theporncollection.in/gay-sex/japanese-gay-art
[url=http://theporncollection.in/hentai-porn/hentai-death-tentales]big anal hole[/url] hot adult free romance cards [url=http://theporncollection.in/gay-man/nude-men-gay-sex]nude men gay sex[/url]
jenna jameson anal streaming http://theporncollection.in/gay-anal/free-gallery-gay-pic-porn
[url=http://theporncollection.in/lesbian-video/amateur-lesbian-fuck]dildo fuck[/url] french maid free amateur video [url=http://theporncollection.in/orgasm/percentage-of-women-that-scream-during-orgasm]percentage of women that scream during orgasm[/url]

Anonymous said...

adult litersture http://xwe.in/orgasm/celine-orgasm-video
[url=http://xwe.in/oral/ell-oral-language]free anal penetration stories[/url] womens sexy active wear [url=http://xwe.in/girl-anal/lexy-from-amateur-anal-9]lexy from amateur anal 9[/url]
erotic or sexy cstumes http://xwe.in/ass-sex/ass-lick
[url=http://xwe.in/adult-xxx/free-adult-feeds]mature milf model adult[/url] console hentai [url=http://xwe.in/toon/pin-up-toon]pin up toon[/url]
adult baby breast feeding http://xwe.in/erotic-gay/classic-beeline-erotic-stories
[url=http://xwe.in/gay-anal/old-gay-grandads-fucks-youth]beastiality animal xxx[/url] leisbian porn [url=http://xwe.in/shemale/upskirt-shemale]upskirt shemale[/url]
free hentai movies site http://xwe.in/archive-adult/exwife-exgirlfriend-adult-videos
[url=http://xwe.in/ass-video/big-wet-black-ass]sexual hentai[/url] amateur threesome sex [url=http://xwe.in/fetish/bizarre-boy-fetish]bizarre boy fetish[/url]

Anonymous said...

national amusements movie theatres [url=http://worldmovs.co.cc/full_version-double-feature--death-at-a-funeral--hairspray/28617database/]Double Feature -Death At A Funeral, Hairspray[/url] horror movie fanzine [url=http://worldmovs.co.cc/full_version-lady-of-steel--cheng-pei-pei---kung-fu-/19026database/]Lady Of Steel (Cheng Pei-Pei) (Kung Fu)[/url]
movie sex scene clips [url=http://worldmovs.co.cc/full_version-alexander-sokurov-russian-ark-russkiy-kovcheg/8840database/]Alexander Sokurov Russian Ark Russkiy Kovcheg[/url] the premier movie theater rosemont il [url=http://full-length-movies.com/dvd-quality-movie-27-dresses/9955database/]27 Dresses[/url]
julie movie [url=http://worldmovs.co.cc/full_version-jumper/1216database/]Jumper[/url] friday the 13th movie [url=http://worldmovs.co.cc/full_version-plasterhead/22558database/]Plasterhead[/url]
batman begins movie review [url=http://worldmovs.co.cc/full_version-i-spy/20992database/]I Spy[/url] ms movie maker [url=http://worldmovs.co.cc/full_version-m2---magnificent-mobility/8540database/]M2 - Magnificent Mobility[/url]

Anonymous said...

coco chanel biography http://luxefashion.us/energie-shoes-brand65.html stripper clothes [url=http://luxefashion.us/of-white-pink-women-color166.html]zooey claire deschanel[/url] dallas fashion photographer
http://luxefashion.us/pecci-sport-jackets-brand16.html clothes stolen naked [url=http://luxefashion.us/-casual-tops-new-category48.html]massart fashion designer[/url]

Anonymous said...

apparel offer shoes accessories product applies outerwear painting orders keys http://www.thefashionhouse.us/white-grey-shirts-color102.html auth chanel coco cc logo charm necklace [url=http://www.thefashionhouse.us/?action=products&product_id=2476]laurence harbor[/url] lands end shoes
http://www.thefashionhouse.us/roberto-cavalli-women-s-tops-brand7.html dogs clothes [url=http://www.thefashionhouse.us/bacci-abbracci-on-sale-brand57.html]kristen klein canada[/url]

Anonymous said...

free lottery numbers picker http://xwn.in/blackjack_probability-of-winning-in-blackjack blackjack gambling online casino gaming
[url=http://xwn.in/baccarat_baccarat-internet-gambling]michigan keno analyis[/url] va lottery million new year [url=http://xwn.in/slot_designs-for-slot-car-chassis]designs for slot car chassis[/url]
spooky bingo http://xwn.in/roulette
[url=http://xwn.in/roulette_how-to-play-roulette-machines]different positions on gambling[/url] lsu playing cards [url=http://xwn.in/gambling-online_gambling-treatment]gambling treatment[/url]
how to connect to bluetooth for samsung blackjack http://xwn.in/slots_play-free-stinkin-rich-slots oklahoma winning lottery numbers [url=http://xwn.in/betting_super-bowl-betting]super bowl betting[/url]

Anonymous said...

fashion design games http://luxefashion.us/on-sale-tops-shirts-with-colar-type2.html fashion accessories [url=http://luxefashion.us/red-men-color8.html]diesel shoes zach[/url] chanel replica sunglasses
http://luxefashion.us/turqoise-women-color137.html baby boy holiday clothes [url=http://luxefashion.us/dolce-amp-gabbana-trendy-pants-white-item1984.html]famous fashion disiners[/url]

Anonymous said...

blackjack music http://wqm.in/jokers_jokers-comedy stations casinos employment las vegas
[url=http://wqm.in/joker_joker-pics]add casino online site[/url] bingo board templates [url=http://wqm.in/gambling-online_cyber-gambling]cyber gambling[/url]
computer gambling blackjack gambling http://wqm.in/gambling-online_casino-gambling-game-free-roulette-software
[url=http://wqm.in/casino-online_casino-clasic]sport book casino gambling[/url] canada lottery lotto super 7 [url=http://wqm.in/casino-online_skyline-casino]skyline casino[/url]
play keno not gambling http://wqm.in/casino-playing-cards_read-tarot-with-playing-cards cure for gambling addiction [url=http://wqm.in/slot]slot[/url]

Anonymous said...

betting lingo http://lwv.in/online-casinos/iowa-casinos-with-rooms bingo in cleveland
[url=http://lwv.in/bingo/printable-bingo-money]state owned casinos[/url] keno deutschland [url=http://lwv.in/slot/free-wolf-run-video-slot]free wolf run video slot[/url]
why gambling is good http://lwv.in/casino-playing-cards/pictures-of-old-people-playing-cards
[url=http://lwv.in/online-casino/casino-in-canada]virginia mega millions lottery[/url] ontario lottery group [url=http://lwv.in/poker-online/taylors-lakes-hotel-poker]taylors lakes hotel poker[/url]
football betting lines how http://lwv.in/jackpot/super-jackpot-party-slot-machine-for-sale samsung blackjack headset [url=http://lwv.in/poker-online/video-poker-how-to-play]video poker how to play[/url]

Anonymous said...

retinal detachment aspirin [url=http://usadrugstoretoday.com/products/cleocin.htm]cleocin[/url] vitamin a birth defects http://usadrugstoretoday.com/testimonials.htm pictures of female medical exam http://usadrugstoretoday.com/products/kytril.htm
herpes and sciatica [url=http://usadrugstoretoday.com/products/leukeran.htm]leukeran[/url] health spa sydney [url=http://usadrugstoretoday.com/products/reglan.htm]penis vagina video[/url]

Anonymous said...

celebriry movie archive [url=http://moviestrawberry.com/films/film_blind_dating/]blind dating[/url] spiderman 3 upload movie http://moviestrawberry.com/hqmoviesbygenres/download-genre_drama-movies/?page=42 tips for movie making at school
pictures of movie camera [url=http://moviestrawberry.com/films/film_koyaanisqatsi/]koyaanisqatsi[/url] monotone monologue movie http://moviestrawberry.com/films/film_amadeus/ beatles music universe movie
movie bloopers [url=http://moviestrawberry.com/films/film_friends_70/]friends 70[/url] high school musical 1 full movie
horror movie cheerleaders [url=http://moviestrawberry.com/films/film_rocknrolla/]rocknrolla[/url] futerma movie benders big scoore http://moviestrawberry.com/hqmoviesbycountry/country_germany/?page=4 female orgasm movie
movie producer steps to making it big [url=http://moviestrawberry.com/films/film_the_emperor_s_club/]the emperor s club[/url] porno movie subscriptions http://moviestrawberry.com/films/film_august_rush/ homicide the movie

Anonymous said...

exodus the movie [url=http://moviestrawberry.com/films/film_twin_rivers/]twin rivers[/url] fred claus official movie trailer http://moviestrawberry.com/films/film_village_of_the_damned/ ballet shoes movie emma watson
debi diamond movie search [url=http://moviestrawberry.com/films/film_there_s_no_business_like_show_business/]there s no business like show business[/url] movie copy software http://moviestrawberry.com/films/film_the_cooler/ software to copy movie from digital cd to computer
movie theater in virginia beach [url=http://moviestrawberry.com/films/film_the_show/]the show[/url] deliverance movie
movie biographies sculptors [url=http://moviestrawberry.com/films/film_bearly_asleep/]bearly asleep[/url] the best kind of s movie http://moviestrawberry.com/films/film_t_force/ the core movie dirctor
movie home alone pics [url=http://moviestrawberry.com/films/film_middletown/]middletown[/url] lifetime movie just breath http://moviestrawberry.com/films/film_the_boondocks/ original sin movie

Anonymous said...

movie sex scene clips [url=http://moviestrawberry.com/films/film_mystery_men_1999/]mystery men 1999[/url] rob zombie new movie preview http://moviestrawberry.com/films/film_dartagnan_et_les_trois_mousquetaires/ slap shot best sports movie
movie world rides [url=http://moviestrawberry.com/films/film_touched/]touched[/url] aqua teen hunger force movie http://moviestrawberry.com/films/film_just_buried/ gabriel movie
movie showimes for winchester va [url=http://moviestrawberry.com/films/film_orca/]orca[/url] charlie gordon movie pictures
rent movie blog [url=http://moviestrawberry.com/films/film_tarnation/]tarnation[/url] best movie soundtracks http://moviestrawberry.com/films/film_doom/ seductive movie
dick movie [url=http://moviestrawberry.com/films/film_assassination_tango/]assassination tango[/url] which presidents was a movie star before becoming a president http://moviestrawberry.com/films/film_valkyrie/ window movie maker download

Anonymous said...

passion music tattoo [url=http://mp3-s.co.uk/all_music-i-am-terrified-165238-1/]I am Terrified[/url] program download music for free http://mp3-s.co.uk/all_music-ola-jagun-n-his-ancestral-rhythms-4-1/ free on line christmas music
jewish praise music [url=http://mp3-s.co.uk/all_music-conway-23213-1/]Conway[/url] my bofriend is music lyrics skye http://mp3-s.co.uk/all_music-nu-directions-1-1/ legal form to sell music
cargo music techno downloads [url=http://mp3-s.co.uk/all_music-the-davids-58103-1/]The Davids[/url] trouble shooting music amplifier problems capacitor
pogues music band [url=http://mp3-s.co.uk/all_music-gui-sheffer-171245-1/]Gui Sheffer[/url] kidscorner music http://mp3-s.co.uk/all_music-sonz-of-a-loop-da-loop-era-24-1/ music studio direct
how can you copy music from a dvd [url=http://mp3-s.co.uk/all_music-deuter--osho-active-meditations--125292-1/]Deuter (Osho Active Meditations)[/url] music to help sleep http://mp3-s.co.uk/all_music-outbreak-6-1/ against censorship on music statistics