[{"data":1,"prerenderedAt":511},["ShallowReactive",2],{"content-all-\u002Fphp\u002Fphp-fundamental\u002Finclude-require":3,"related-\u002Fphp\u002Fphp-fundamental\u002Finclude-require":232,"sidebar-content":460},[4],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"tags":11,"date":16,"weight":17,"body":18,"_type":226,"_id":227,"_source":228,"_file":229,"_stem":230,"_extension":231},"\u002Fphp\u002Fphp-fundamental\u002Finclude-require","php-fundamental",false,"","PHP Include and Require","Understanding PHP include and require statements",[12,13,14,15],"php","backend","include","require","2026-05-30",12,{"type":19,"children":20,"toc":220},"root",[21,29,50,108,113,132,175,181,214],{"type":22,"tag":23,"props":24,"children":25},"element","h2",{"id":14},[26],{"type":27,"value":28},"text","Include",{"type":22,"tag":30,"props":31,"children":32},"p",{},[33,35,41,43,48],{"type":27,"value":34},"In PHP, the ",{"type":22,"tag":36,"props":37,"children":39},"code",{"className":38},[],[40],{"type":27,"value":14},{"type":27,"value":42}," statement is used to include and evaluate a specified file. The content of the included file is inserted into the script at the point where the ",{"type":22,"tag":36,"props":44,"children":46},{"className":45},[],[47],{"type":27,"value":14},{"type":27,"value":49}," statement is used. If the file cannot be found, a warning is issued, but the script will continue to execute.",{"type":22,"tag":51,"props":52,"children":55},"pre",{"className":53,"code":54,"language":12,"meta":8,"style":8},"language-php shiki shiki-themes github-light github-dark","include 'header.php'; \u002F\u002F Includes the header.php file\necho \"This is the main content of the page.\";\n",[56],{"type":22,"tag":36,"props":57,"children":58},{"__ignoreMap":8},[59,88],{"type":22,"tag":60,"props":61,"children":64},"span",{"class":62,"line":63},"line",1,[65,70,76,82],{"type":22,"tag":60,"props":66,"children":68},{"style":67},"--shiki-default:#D73A49;--shiki-dark:#F97583",[69],{"type":27,"value":14},{"type":22,"tag":60,"props":71,"children":73},{"style":72},"--shiki-default:#032F62;--shiki-dark:#9ECBFF",[74],{"type":27,"value":75}," 'header.php'",{"type":22,"tag":60,"props":77,"children":79},{"style":78},"--shiki-default:#24292E;--shiki-dark:#E1E4E8",[80],{"type":27,"value":81},"; ",{"type":22,"tag":60,"props":83,"children":85},{"style":84},"--shiki-default:#6A737D;--shiki-dark:#6A737D",[86],{"type":27,"value":87},"\u002F\u002F Includes the header.php file\n",{"type":22,"tag":60,"props":89,"children":91},{"class":62,"line":90},2,[92,98,103],{"type":22,"tag":60,"props":93,"children":95},{"style":94},"--shiki-default:#005CC5;--shiki-dark:#79B8FF",[96],{"type":27,"value":97},"echo",{"type":22,"tag":60,"props":99,"children":100},{"style":72},[101],{"type":27,"value":102}," \"This is the main content of the page.\"",{"type":22,"tag":60,"props":104,"children":105},{"style":78},[106],{"type":27,"value":107},";\n",{"type":22,"tag":23,"props":109,"children":110},{"id":15},[111],{"type":27,"value":112},"Require",{"type":22,"tag":30,"props":114,"children":115},{},[116,118,123,125,130],{"type":27,"value":117},"The ",{"type":22,"tag":36,"props":119,"children":121},{"className":120},[],[122],{"type":27,"value":15},{"type":27,"value":124}," statement is similar to ",{"type":22,"tag":36,"props":126,"children":128},{"className":127},[],[129],{"type":27,"value":14},{"type":27,"value":131},", but it behaves differently when the specified file cannot be found. If the file cannot be found, a fatal error is issued, and the script will stop executing.",{"type":22,"tag":51,"props":133,"children":135},{"className":53,"code":134,"language":12,"meta":8,"style":8},"require 'config.php'; \u002F\u002F Requires the config.php file or stops execution if it cannot be found\necho \"This is the main content of the page.\";\n",[136],{"type":22,"tag":36,"props":137,"children":138},{"__ignoreMap":8},[139,160],{"type":22,"tag":60,"props":140,"children":141},{"class":62,"line":63},[142,146,151,155],{"type":22,"tag":60,"props":143,"children":144},{"style":67},[145],{"type":27,"value":15},{"type":22,"tag":60,"props":147,"children":148},{"style":72},[149],{"type":27,"value":150}," 'config.php'",{"type":22,"tag":60,"props":152,"children":153},{"style":78},[154],{"type":27,"value":81},{"type":22,"tag":60,"props":156,"children":157},{"style":84},[158],{"type":27,"value":159},"\u002F\u002F Requires the config.php file or stops execution if it cannot be found\n",{"type":22,"tag":60,"props":161,"children":162},{"class":62,"line":90},[163,167,171],{"type":22,"tag":60,"props":164,"children":165},{"style":94},[166],{"type":27,"value":97},{"type":22,"tag":60,"props":168,"children":169},{"style":72},[170],{"type":27,"value":102},{"type":22,"tag":60,"props":172,"children":173},{"style":78},[174],{"type":27,"value":107},{"type":22,"tag":23,"props":176,"children":178},{"id":177},"conclusion",[179],{"type":27,"value":180},"Conclusion",{"type":22,"tag":30,"props":182,"children":183},{},[184,186,191,193,198,200,205,207,212],{"type":27,"value":185},"Both ",{"type":22,"tag":36,"props":187,"children":189},{"className":188},[],[190],{"type":27,"value":14},{"type":27,"value":192}," and ",{"type":22,"tag":36,"props":194,"children":196},{"className":195},[],[197],{"type":27,"value":15},{"type":27,"value":199}," are used to include files in PHP, but they differ in their error handling. Use ",{"type":22,"tag":36,"props":201,"children":203},{"className":202},[],[204],{"type":27,"value":14},{"type":27,"value":206}," when the file is optional and the script can continue without it, and use ",{"type":22,"tag":36,"props":208,"children":210},{"className":209},[],[211],{"type":27,"value":15},{"type":27,"value":213}," when the file is essential for the application to run. Always ensure that the paths to the included or required files are correct to avoid errors.",{"type":22,"tag":215,"props":216,"children":217},"style",{},[218],{"type":27,"value":219},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":8,"searchDepth":221,"depth":221,"links":222},3,[223,224,225],{"id":14,"depth":90,"text":28},{"id":15,"depth":90,"text":112},{"id":177,"depth":90,"text":180},"markdown","content:php:php-fundamental:include-require.md","content","php\u002Fphp-fundamental\u002Finclude-require.md","php\u002Fphp-fundamental\u002Finclude-require","md",[233,241,249,254,260,269,274,279,284,289,294,303,309,314,319,324,329,334,340,348,356,361,368,373,380,386,392,400,406,412,418,424,431,443,449,454],{"_path":234,"title":235,"description":236,"tags":237,"date":240},"\u002Fcpp","C++ \u002F CPP","C++ notes, snippets, and references",[238,239],"cpp","c++","2026-05-05",{"_path":242,"title":243,"description":244,"tags":245,"date":248},"\u002Fdata-structure-algorithm\u002Farray-manipulation\u002Ffor-looping","For Looping in Python","Using for loops to manipulate arrays in Python.",[246,13,247],"python","arrays","2026-03-18",{"_path":250,"title":251,"description":252,"tags":253,"date":248},"\u002Fdata-structure-algorithm\u002Farray-manipulation\u002Fwhile-looping","While Looping in Python","Using while loops to manipulate arrays in Python.",[246,13,247],{"_path":255,"title":256,"description":257,"tags":258,"date":259},"\u002Fdata-structure-algorithm\u002Fassignments","Assignments","Assignments in Python for competitive programming.",[246,13],"2026-04-10",{"_path":261,"title":262,"description":263,"tags":264,"date":268},"\u002Fdata-structure-algorithm\u002Fbuzzword","Buzzword List DSA","Common terms and concepts in data structures and algorithms.",[265,266,267],"dsa","algorithms","data-structures","2026-04-03",{"_path":270,"title":271,"description":272,"tags":273,"date":259},"\u002Fdata-structure-algorithm\u002Fdata-type","Data Types","Data types in Python for competitive programming.",[246,13],{"_path":275,"title":276,"description":277,"tags":278,"date":259},"\u002Fdata-structure-algorithm\u002Fhash-map","Hash Map","Hash map implementation in Python for competitive programming.",[246,13],{"_path":280,"title":281,"description":282,"tags":283,"date":259},"\u002Fdata-structure-algorithm\u002Finput-output","Input and Output","Handling input and output in Python for competitive programming.",[246,13],{"_path":285,"title":286,"description":287,"tags":288,"date":248},"\u002Fdata-structure-algorithm\u002Fmath-library\u002Fsum","Sum Elements","Using for loops to sum elements in Python.",[246,13,247],{"_path":290,"title":291,"description":292,"tags":293,"date":248},"\u002Fdata-structure-algorithm\u002Fmath-library\u002Fsummary","Summary","Summary of the math library in Python.",[246,13,247],{"_path":295,"title":296,"description":297,"tags":298,"date":302},"\u002Fdocker\u002Fcheat-sheets","Docker Cheat Sheets","Cheat sheets for frequently used Docker commands and concepts",[299,300,301],"docker","devops","infrastructure","2026-05-01",{"_path":304,"title":305,"description":306,"tags":307,"date":308},"\u002Fdocker\u002Fdocker-dasar\u002Fdocker-container","Docker Container","Introduction to Docker containers and their usage",[299,300,301],"2026-03-12",{"_path":310,"title":311,"description":312,"tags":313,"date":308},"\u002Fdocker\u002Fdocker-dasar\u002Fdocker-execution","Docker Execution","Introduction to Docker execution and their usage",[299,300,301],{"_path":315,"title":316,"description":317,"tags":318,"date":308},"\u002Fdocker\u002Fdocker-dasar\u002Fdocker-image","Docker Image","Introduction to Docker images and their usage",[299,300,301],{"_path":320,"title":321,"description":322,"tags":323,"date":308},"\u002Fdocker\u002Fdocker-dasar\u002Fdocker-logging","Docker Logging","Introduction to Docker logging and their usage",[299,300,301],{"_path":325,"title":326,"description":327,"tags":328,"date":308},"\u002Fdocker\u002Fdocker-prerequisites\u002Fdocker-installation","Docker Installation","Introduction to Docker installation and their usage",[299,300,301],{"_path":330,"title":331,"description":332,"tags":333,"date":308},"\u002Fdocker\u002Fresources","Docker Resources","Collection of Docker resources for learning and reference",[299,300,301],{"_path":335,"title":336,"description":337,"tags":338,"date":240},"\u002Fjava","Java","Java notes, snippets, and references",[339],"java",{"_path":341,"title":342,"description":343,"tags":344,"date":308},"\u002Fjavascript\u002Fpromises","Promise Patterns","Common JavaScript promise patterns and async\u002Fawait usage",[345,346,347],"javascript","frontend","async",{"_path":349,"title":350,"description":351,"tags":352,"date":240},"\u002Fjenkins","Jenkins","Jenkins notes, snippets, and references",[353,354,355],"jenkins","ci","cd",{"_path":357,"title":358,"description":359,"tags":360,"date":248},"\u002Fphp\u002Farrays","PHP Array Functions","Essential PHP array functions and patterns",[12,13,247],{"_path":362,"title":363,"description":364,"tags":365,"date":367},"\u002Fphp\u002Fpatterns\u002Fsingleton","Singleton Pattern","Implementing the singleton pattern in PHP",[12,366,13],"patterns","2026-03-13",{"_path":369,"title":370,"description":371,"tags":372,"date":16},"\u002Fphp\u002Fphp-fundamental\u002Farray-map","PHP Array and Map","Essential PHP array and map functions and their usage",[12,13,247],{"_path":374,"title":375,"description":376,"tags":377,"date":16},"\u002Fphp\u002Fphp-fundamental\u002Fcasting-convertions","PHP Casting and Conversions","Learning about PHP casting and conversions",[12,13,378,379],"casting","conversions",{"_path":381,"title":382,"description":383,"tags":384,"date":16},"\u002Fphp\u002Fphp-fundamental\u002Fcomments","PHP Comments","Essential PHP comment operations",[12,13,385],"comments",{"_path":387,"title":388,"description":389,"tags":390,"date":16},"\u002Fphp\u002Fphp-fundamental\u002Fdatatypes","PHP Data Types","Essential PHP data types and their usage",[12,13,391],"data types",{"_path":393,"title":394,"description":395,"tags":396,"date":16},"\u002Fphp\u002Fphp-fundamental\u002Fexpression-statement-block","PHP Expressions, Statements, and Blocks","Essential PHP expressions, statements, and blocks",[12,13,397,398,399],"expressions","statements","blocks",{"_path":401,"title":402,"description":403,"tags":404,"date":16},"\u002Fphp\u002Fphp-fundamental\u002Fflow-control","PHP Flow Control","Essential PHP flow control structures and patterns",[12,13,405],"flow control",{"_path":407,"title":408,"description":409,"tags":410,"date":16},"\u002Fphp\u002Fphp-fundamental\u002Ffunctions","PHP Functions","Essential PHP functions and their usage",[12,13,411],"functions",{"_path":413,"title":414,"description":415,"tags":416,"date":16},"\u002Fphp\u002Fphp-fundamental\u002Fintroduction","PHP Introduction","An introduction to PHP programming language and its fundamentals",[12,13,417],"introduction",{"_path":419,"title":420,"description":421,"tags":422,"date":16},"\u002Fphp\u002Fphp-fundamental\u002Foperator","PHP Operators","Essential PHP operators and their usage",[12,13,423],"operators",{"_path":425,"title":426,"description":427,"tags":428,"date":16},"\u002Fphp\u002Fphp-fundamental\u002Foutput-input","PHP Output & Input","Learning about PHP output and input methods",[12,13,429,430],"output","input",{"_path":432,"title":433,"description":434,"tags":435,"date":16},"\u002Fphp\u002Fphp-fundamental\u002Fvariables","PHP Variables","Essential PHP variables, constants, magic constants, and variable scope",[12,13,436,437,438,439,440,441,442],"variables","constants","magic constants","scope","global","local","static",{"_path":444,"title":445,"description":446,"tags":447,"date":448},"\u002Fphp\u002Freferences","PHP References (&)","Useful PHP reference snippets and patterns",[12,13],"2026-03-19",{"_path":450,"title":451,"description":452,"tags":453,"date":240},"\u002Fpython","Python","Python notes, snippets, and references",[246],{"_path":455,"title":456,"description":457,"tags":458,"date":240},"\u002Frust","Rust","Rust notes, snippets, and references",[459],"rust",[461,462,464,465,466,467,468,469,470,472,473,475,476,478,480,482,483,484,485,486,487,488,489,491,493,494,496,498,499,501,502,503,505,506,508,509,510],{"_path":234,"title":235,"weight":63},{"_path":242,"title":243,"weight":463},10,{"_path":250,"title":251,"weight":463},{"_path":255,"title":256,"weight":221},{"_path":261,"title":262,"weight":63},{"_path":270,"title":271,"weight":90},{"_path":275,"title":276,"weight":463},{"_path":280,"title":281,"weight":63},{"_path":285,"title":286,"weight":471},20,{"_path":290,"title":291,"weight":463},{"_path":295,"title":296,"weight":474},100,{"_path":304,"title":305,"weight":471},{"_path":310,"title":311,"weight":477},22,{"_path":315,"title":316,"weight":479},21,{"_path":320,"title":321,"weight":481},23,{"_path":325,"title":326,"weight":463},{"_path":330,"title":331,"weight":63},{"_path":335,"title":336,"weight":63},{"_path":341,"title":342},{"_path":349,"title":350,"weight":63},{"_path":357,"title":358,"weight":63},{"_path":362,"title":363},{"_path":369,"title":370,"weight":490},9,{"_path":374,"title":375,"weight":492},6,{"_path":381,"title":382,"weight":221},{"_path":387,"title":388,"weight":495},5,{"_path":393,"title":394,"weight":497},8,{"_path":401,"title":402,"weight":463},{"_path":407,"title":408,"weight":500},11,{"_path":5,"title":9,"weight":17},{"_path":413,"title":414,"weight":63},{"_path":419,"title":420,"weight":504},7,{"_path":425,"title":426,"weight":90},{"_path":432,"title":433,"weight":507},4,{"_path":444,"title":445,"weight":90},{"_path":450,"title":451,"weight":63},{"_path":455,"title":456,"weight":63},1780160028616]