{"id":1546,"date":"2021-07-09T19:54:36","date_gmt":"2021-07-09T14:24:36","guid":{"rendered":"https:\/\/selfimagination.in\/tips\/?p=1546"},"modified":"2021-07-09T19:59:42","modified_gmt":"2021-07-09T14:29:42","slug":"php-control-structures","status":"publish","type":"post","link":"https:\/\/selfimagination.in\/tips\/php-control-structures\/","title":{"rendered":"PHP Control Structures"},"content":{"rendered":"\n<p class=\"wp-block-zozuk-wphindi\">Control Structure \u0915\u094b \u0938\u092e\u091d\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0939\u092e \u0907\u0938\u0947 4 \u092d\u093e\u0917\u094b \u092e\u0947\u0902 Divide \u0915\u0930 \u0930\u0939\u0947 \u0939\u0948\u0902 <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Conditional<\/strong><ul><li>if<\/li><li>else<\/li><li>elseif\/else if<\/li><li>switch<\/li><\/ul><\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Loop<\/strong><ul><li>while<\/li><li>do-while<\/li><li>for<\/li><li>foreach<\/li><\/ul><\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Jump<\/strong><ul><li>break<\/li><li>continue<\/li><li>return<\/li><li>goto<\/li><\/ul><\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>File<\/strong><ul><li>require<\/li><li>include<\/li><li>require_once<\/li><li>include_once<\/li><\/ul><\/li><\/ul>\n\n\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">if<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u091c\u092c \u092d\u0940 \u0939\u092e \u0915\u094b\u0908 Condition \u0932\u0917\u093e\u0928\u093e \u091a\u093e\u0939\u0924\u0947 \u0939\u0948\u0902 \u0924\u092c \u0939\u092e IF \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0924\u0947 \u0939\u0948\u0902 \u091c\u093f\u0938\u0947 \u0939\u092e \u0907\u0938 \u092a\u094d\u0930\u0915\u093e\u0930 \u0938\u0947 \u0938\u092e\u091d \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 <\/p>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u091c\u092c if \u0915\u0947 \u092c\u093e\u0926 () \u092e\u0947\u0902 \u0932\u093f\u0916\u0940 condition True \u0939\u094b\u0917\u0940 \u0924\u094b \u092f\u0939 Curley Bracket {} \u092e\u0947\u0902 \u0932\u093f\u0916\u0947 Statement \u0915\u094b Execute \u0915\u0930 \u0926\u0947\u0917\u093e \u0964 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\n\/\/Single Line Condition\nif&nbsp;($x&nbsp;&gt;&nbsp;$y)\n&nbsp;&nbsp;echo&nbsp;\"x&nbsp;is&nbsp;bigger&nbsp;than&nbsp;y\";\n\n\/\/Multi Line Condition\nif&nbsp;($x&nbsp;&gt;&nbsp;$y)\n{\n  echo&nbsp;\"Hello\";\n&nbsp;&nbsp;echo&nbsp;\"x&nbsp;is&nbsp;bigger&nbsp;than&nbsp;y\";\n}\n\n?&gt;<\/code><\/pre>\n\n\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">else<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u091c\u092c if condition true \u0928 \u0939\u094b \u0924\u094b \u0939\u092e else \u0932\u0917\u093e \u0915\u0930 false condition \u092a\u0930 \u092d\u0940 Statement Execute \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u0964 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\n\/\/Single Line Condition\nif&nbsp;($x&nbsp;&gt;&nbsp;$y)\n&nbsp;&nbsp;echo&nbsp;\"x&nbsp;is&nbsp;bigger&nbsp;than&nbsp;y\";\nelse\n&nbsp;&nbsp;echo&nbsp;\"y&nbsp;is&nbsp;bigger&nbsp;than&nbsp;x\";\n\n\/\/Multi Line Condition\nif&nbsp;($x&nbsp;&gt;&nbsp;$y)\n{\n  echo&nbsp;\"Hello\";\n&nbsp;&nbsp;echo&nbsp;\"x&nbsp;is&nbsp;bigger&nbsp;than&nbsp;y\";\n}\nelse\n{\n  echo&nbsp;\"Hello\";\n&nbsp;&nbsp;echo&nbsp;\"y&nbsp;is&nbsp;bigger&nbsp;than&nbsp;x\";\n}\n\n?&gt;<\/code><\/pre>\n\n\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">elseif\/else if<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u091c\u092c \u0939\u092e\u0947\u0902 \u092f\u0926\u093f \u0928\u0939\u0940\u0902 (else) \u0915\u0947 \u092f\u0939\u093e\u0901 \u092d\u0940 \u0915\u094b\u0908 Condition \u0932\u0917\u093e\u0928\u093e \u0939\u094b \u0924\u094b \u0939\u092e elseif \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0924\u0947 \u0939\u0948\u0902 .<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\nif&nbsp;($x&nbsp;&gt;&nbsp;$y)\n{\n&nbsp;&nbsp;echo&nbsp;\"x&nbsp;is&nbsp;bigger&nbsp;than&nbsp;y\";\n}\nelseif ($x&nbsp;==&nbsp;$y)\n{\n&nbsp;&nbsp;echo&nbsp;\"x&nbsp;is&nbsp;equal to y\";\n}\nelse\n{\n&nbsp;&nbsp;echo&nbsp;\"y&nbsp;is&nbsp;bigger&nbsp;than&nbsp;x\";\n}\n\n?&gt;<\/code><\/pre>\n\n\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">switch<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u091c\u092c \u0939\u092e\u0947\u0902 \u090f\u0915 \u0939\u0940 \u0935\u0947\u0930\u093f\u090f\u092c\u0932 \u092a\u0930 \u090f\u0915 \u0938\u0947 \u0905\u0927\u093f\u0915 condition \u0932\u0917\u093e\u0928\u093e \u0939\u094b \u0924\u094b \u0939\u092e if \u0915\u0947 \u0938\u094d\u0925\u093e\u0928 \u092a\u0930 switch \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u0964<\/p>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">Switch \u092e\u0947\u0902 break \u0932\u0917\u093e\u0928\u093e \u0906\u0935\u0936\u094d\u092f\u0915 \u0939\u094b\u0924\u093e \u0939\u0948\u0902, \u092f\u0926\u093f break \u0932\u0917\u093e\u090f\u0902\u0917\u0947 \u0924\u094b \u0935\u0939 Switch Statement \u0938\u0947 \u092c\u093e\u0939\u0930 \u0906 \u091c\u093e\u092f\u0947\u0902\u0917\u0947 \u0964<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\n\n$myclass = 5\n\nswitch&nbsp;($myclass)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;1:\n&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;2:\n&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;3:\n&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;4:\n&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;5:\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;\"Primary School\";\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;\n&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;6:\n&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;7:\n&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;8:\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;\"Middle School\";\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;\n&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;9:\n&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;10:\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;\"High School\";\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;\n    case else:\n&nbsp;      echo&nbsp;\"Higher Secondary School\";\n}\n\n?&gt;<\/code><\/pre>\n\n\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">while<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u092f\u0939 \u090f\u0915 \u0932\u0942\u092a \u0939\u0948\u0902 loop \u0938\u0947 \u092e\u0924\u0932\u092c \u0915\u0940 Cursor \u092c\u093e\u0930 \u092c\u093e\u0930 statement \u0915\u094b Execute \u0915\u0930\u0924\u093e \u0939\u0948\u0902 , while \u0915\u0947 \u092c\u093e\u0926 Brackate \u092e\u0947\u0902 condition \u0926\u0940 \u091c\u093e\u0924\u0940 \u0939\u0948\u0902 \u092f\u0926\u093f Condition true \u0939\u0941\u0908 \u0924\u094b Program Cursor Curley Brackate \u092e\u0947\u0902 \u091c\u093e\u092f\u0947\u0917\u093e \u0914\u0930 \u092f\u0926\u093f Condition False \u0939\u0941\u0908 \u0924\u094b while loop \u0938\u0947 \u092c\u093e\u0939\u0930 \u0939\u094b \u091c\u093e\u090f\u0917\u093e \u0964 <\/p>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u092f\u0926\u093f \u092f\u0939\u093e\u0901 \u092a\u0930 \u0906\u092a $i \u0915\u094b increment \u0915\u0930\u0928\u093e \u092d\u0942\u0932 \u0917\u090f \u0924\u094b \u092f\u0939 infinite loop \u092c\u0928 \u091c\u093e\u092f\u0947\u0917\u093e \u0914\u0930 \u0915\u0902\u092a\u094d\u092f\u0942\u091f\u0930 \u0939\u0948\u0902\u0917 \u092d\u0940 \u0939\u094b \u0938\u0915\u0924\u093e \u0939\u0948\u0902 \u0964<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\n\n$i&nbsp;=&nbsp;1;\nwhile&nbsp;($i&nbsp;&lt;=&nbsp;5)&nbsp;\n{\n&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;$i .'&lt;br&gt;';\n    $i++;&nbsp;&nbsp;\n}\n\n?&gt;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">do-while<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">do&#8230;.while, while \u091c\u0948\u0938\u093e \u0939\u0940 \u0932\u0942\u092a \u0939\u0948\u0902, \u0907\u0938\u0915\u0940 \u092f\u0939 \u0935\u093f\u0936\u0947\u0937\u0924\u093e \u0939\u0948\u0902 \u0915\u0940 \u092f\u0939 \u0915\u092e \u0938\u0947 \u0915\u092e \u090f\u0915 \u092c\u093e\u0930 \u0924\u094b Execute \u0939\u094b\u0924\u093e \u0939\u0940 \u0939\u0948\u0902 , \u092f\u0939 \u090f\u0915 Exit Control loop \u0939\u0948\u0902 \u0907\u0938\u092e\u0947\u0902 \u092a\u0939\u0932\u0947 Statement Execute \u0939\u094b\u0924\u0947 \u0939\u0948\u0902 \u092b\u093f\u0930 Condition Check \u0939\u094b\u0924\u0940 \u0939\u0948\u0902 \u092f\u0926\u093f Condition True \u0939\u0941\u090f \u0924\u094b Loop \u092e\u0947\u0902 \u091c\u093e\u0924\u093e \u0939\u0948\u0902 Otherwise Exit \u0939\u094b \u091c\u093e\u0924\u093e \u0939\u0948\u0902 \u0964<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\n$i&nbsp;=&nbsp;1;\ndo&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;$i .'&lt;br&gt;';\n    $i++;&nbsp;&nbsp;\n}&nbsp;while&nbsp;($i&nbsp;&lt;&nbsp;1);\n?&gt; <\/code><\/pre>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">Loop \u0915\u0940 condition satisfy \u0928\u0939\u0940\u0902 \u0939\u094b \u0930\u0939\u0940 \u0924\u092c \u092d\u0940 \u092f\u0939 Loop \u090f\u0915 \u092c\u093e\u0930 Execute \u0939\u094b\u0917\u093e , \u0915\u094d\u092f\u0941\u0915\u0940 \u092f\u0939 Exit Control Loop \u0939\u0948\u0902 \u0964<\/p>\n\n\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">for<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u092f\u0939 \u092d\u0940 \u090f\u0915 \u0932\u0942\u092a \u0939\u0948\u0902, \u0907\u0938 \u0932\u0942\u092a \u092e\u0947\u0902 \u0939\u092e Initial&nbsp;, Condition&nbsp; \u0914\u0930 increment \u0906\u0926\u093f ( )\u092e\u0947\u0902 \u0939\u0940 \u0926\u0947 \u0926\u0947\u0924\u0947 \u0939\u0948\u0902 , \u091c\u092c \u0939\u092e\u0947\u0902 \u092a\u0924\u093e \u0939\u094b\u0924\u093e \u0939\u0948 \u0915\u0940 \u0932\u0942\u092a \u0915\u093f\u0924\u0928\u0940 \u092c\u093e\u0930 \u091a\u0932\u0928\u093e \u0939\u0948\u0902 \u0924\u092c \u0939\u092e for loop \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0924\u0947 \u0939\u0948\u0902 \u0964&nbsp;   <\/p>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u0907\u0938 Example \u0938\u0947 \u0906\u092a\u0915\u094b \u0938\u092e\u091d \u092e\u0947\u0902 \u0906 \u091c\u093e\u092f\u0947\u0917\u093e \u0915\u0940 \u0915\u093f\u0938 \u0924\u0930\u0939 \u0938\u0947 For Loop \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0924\u0947 \u0939\u0948\u0902 \u0964<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\n\nfor&nbsp;($i&nbsp;=&nbsp;1;&nbsp;$i&nbsp;&lt;=&nbsp;5;&nbsp;$i++)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;$i . '&lt;BR&gt;';\n}\n\n?&gt;<\/code><\/pre>\n\n\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">foreach<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u091c\u092c \u0939\u092e\u0947\u0902 \u0915\u093f\u0938\u0940 Array \u092a\u0930 \u0915\u094b\u0908 Loop Execute \u0915\u0930\u0928\u093e \u0939\u094b \u0924\u092c \u0939\u092e Foreach \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0924\u0947 \u0939\u0948\u0902, \u0907\u0938\u0915\u0947 \u0932\u093f\u090f \u0939\u092e\u0947\u0902 Array \u0915\u0940 length Count \u0915\u0930\u0928\u0947 \u0915\u0940 \u091c\u0930\u0941\u0930\u0924 \u0928\u0939\u0940\u0902 \u0939\u094b\u0924\u0940 \u092f\u0939 \u0915\u093e\u0930\u094d\u092f \u0932\u0942\u092a \u0939\u0940 \u0915\u0930 \u0932\u0947\u0924\u093e \u0939\u0948\u0902 \u0906\u0907\u092f\u0947 \u0938\u092e\u091d\u0924\u0947 \u0939\u0948\u0902 \u0964<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php \n\n$MyArray&nbsp;=&nbsp;array(1,&nbsp;2,&nbsp;4,&nbsp;8, 16);\n\nforeach&nbsp;($arr&nbsp;as&nbsp;$key&nbsp;=&gt;&nbsp;$value)&nbsp;{\n&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;\"$key&nbsp;=&gt;&nbsp;$value&nbsp;&lt;br&gt;\";\n}\n\n?&gt;<\/code><\/pre>\n\n\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">break<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u091c\u092c \u0939\u092e\u0947\u0902 \u0915\u093f\u0938\u0940 Loop \u092f\u093e Switch \u0915\u0947  Execution \u0938\u0947 \u092c\u093e\u0939\u0930 \u0906\u0928\u093e \u0939\u0948\u0902,  \u092f\u093e\u0928\u093f \u0939\u092e \u0915\u092d\u0940 \u092c\u093f\u091a \u092e\u0947\u0902 \u0938\u0947 \u0932\u0942\u092a \u092e\u0947\u0902 \u0938\u0947 \u092c\u093e\u0939\u0930 \u0906\u0928\u093e \u091a\u093e\u0939\u0924\u0947 \u0939\u0948\u0902 \u0924\u094b \u0906\u092a break \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u0964 \u092f\u0939 statement <code>for<\/code>,&nbsp;<code>foreach<\/code>,&nbsp;<code>while<\/code>,&nbsp;<code>do-while<\/code>&nbsp; \u092a\u0930 \u0915\u093e\u0930\u094d\u092f \u0915\u0930\u0924\u093e \u0939\u0948\u0902 \u0964<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php \n\n$i=1;\nwhile ($i &lt; 10) \n{\n     echo $i .'&lt;br&gt;';\n     $i++;\n     if ($i == 5)\n     {\n         break;\n     }\n<code><span style=\"color: rgb(30, 30, 30); font-family: Menlo, Consolas, monaco, monospace; background-color: rgb(255, 255, 255);\">}<\/span><\/code>\n?&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u0909\u092a\u0930\u094b\u0915\u094d\u0924 \u0932\u0942\u092a \u0915\u0947 \u0906\u0909\u091f\u092a\u0941\u091f \u092e\u0947\u0902 1,2,3,4 \u0906\u090f\u0917\u093e, \u091c\u0948\u0938\u0947 \u0939\u0940 4 print \u0939\u094b\u0917\u093e \u0909\u0938\u0915\u0947 \u092c\u093e\u0926 Increment \u0939\u094b\u0917\u093e \u091c\u093f\u0938\u0938\u0947 i \u0915\u0940 \u0935\u0948\u0932\u094d\u092f\u0942 5 \u0939\u094b \u091c\u093e\u090f\u0917\u0940 \u0914\u0930 \u0932\u0942\u092a \u0938\u0947 break \u0939\u094b \u091c\u093e\u090f\u0917\u093e \u0964<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n\n\n<h2 class=\"wp-block-heading\">continue<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u091c\u092c Loop \u0915\u0947 current Execution \u0915\u0940 bypass \u0915\u0930\u0928\u093e \u0939\u094b \u0924\u092c \u0939\u092e Continue \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0924\u0947 \u0939\u0948\u0902 \u091c\u0948\u0938\u0947 \u0939\u092e\u0947\u0902 \u0915\u094b\u0908 loop Execute \u0915\u093f\u092f\u093e \u091c\u093f\u0938\u0947  1 \u0938\u0947 10 \u0924\u0915 \u091a\u0932\u0928\u093e \u0939\u0948\u0902 \u0905\u092c \u0939\u092e \u091a\u093e\u0939\u0924\u0947 \u0939\u0948\u0902 \u0915\u0940 5 \u0935\u093e\u0932\u093e Execution bypass \u0939\u094b \u091c\u093e\u092f\u0947 \u0924\u092c \u0939\u092e 5 \u092a\u0930 continue \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0947\u0902\u0917\u0947 \u0964 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\n $i=0;\n while ($i &lt; 10) \n {\n    $i++;\n    if ($i == 5)\n    {\n         continue;\n    }\n    echo $i ;\n }\n?><\/code><\/pre>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u0907\u0938 Loop \u0915\u0947 output \u092e\u0947\u0902 \u0915\u0941\u091b \u0907\u0938 \u0924\u0930\u0939 \u0938\u0947 \u092a\u094d\u0930\u093f\u0902\u091f \u0939\u094b\u0917\u093e 1234678910 \u091c\u0939\u093e \u092a\u0930 5 \u0935\u093e\u0932\u0947 \u092a\u0930 echo Execute \u0928\u0939\u0940\u0902 \u0939\u0941\u0906 \u0909\u0938\u0915\u093e \u0915\u093e\u0930\u0923 continue \u0939\u0948\u0902 \u0915\u094d\u092f\u0941\u0915\u0940 \u0909\u0938\u0938\u0947 Current Execution Bypass \u0939\u094b \u0917\u092f\u093e  \u0964<\/p>\n\n\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">return<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u0915\u093f\u0938\u0940 \u092d\u0940 script \u0915\u0947 current Scope \u0938\u0947 \u092c\u093e\u0939\u0930 \u0906\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f return \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u093f\u092f\u093e \u091c\u093e\u0924\u093e \u0939\u0948\u0902 , \u0905\u0927\u093f\u0915\u0924\u0930 \u0915\u093f\u0938\u0940 \u092d\u0940 \u092b\u0902\u0915\u094d\u0936\u0928 \u0915\u0947 Execution \u0915\u094b stop \u0915\u0930\u0928\u0947 \u0914\u0930 Value return \u0915\u0930\u0928\u0947 \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u092d\u0940 \u0907\u0938\u0915\u0947 \u0926\u094d\u0935\u093e\u0930\u093e \u0915\u093f\u092f\u093e \u091c\u093e\u0924\u093e \u0939\u0948\u0902 \u0964<\/p>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\"><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\n\n function MyFunction()\n {\n     echo '2';    \/\/Print\n     return ;\n     echo '3';    \/\/do not Print\n }\n\n echo '1';   \/\/Print\n MyFunction();\n echo '4';   \/\/Print\n return ;\n echo '5';   \/\/do not Print\n\n?&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u0909\u092a\u0930\u094b\u0915\u094d\u0924 Example \u092e\u0947\u0902 1 \u092a\u094d\u0930\u093f\u0902\u091f \u0939\u094b\u0917\u093e \u0909\u0938\u0915\u0947 \u092c\u093e\u0926 Function Call \u0939\u094b\u0917\u093e, Function \u092e\u0947\u0902 \u092d\u0940 \u0915\u0947\u0935\u0932 2 \u0939\u0940 \u092a\u094d\u0930\u093f\u0902\u091f \u0939\u094b\u0917\u093e \u0914\u0930 Return \u0939\u094b \u091c\u093e\u090f\u0917\u093e \u0914\u0930 Program \u0915\u093e Cursor Function \u0915\u0947 \u092c\u093e\u0939\u0930 \u0906\u0915\u0930 4 \u0915\u094b \u092a\u094d\u0930\u093f\u0902\u091f \u0915\u0930\u0947\u0917\u093e \u0914\u0930 \u0909\u0938\u0915\u0947 \u092c\u093e\u0926 Execution Stop \u0939\u094b \u091c\u093e\u090f\u0917\u093e \u0964<\/p>\n\n\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">goto<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">Program \u0915\u0947 Execute Point \u0915\u094b Transfer \u0915\u0930\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f goto \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u093f\u092f\u093e \u091c\u093e\u0924\u093e \u0939\u0948\u0902 , \u091c\u0948\u0938\u093e \u0915\u0940 \u0928\u093f\u092e\u094d\u0928 Example \u092e\u0947\u0902 \u0938\u092e\u091d\u093e\u092f\u093e \u0917\u092f\u093e \u0939\u0948\u0902 \u0915\u0940 goto \u0915\u0947 \u092c\u093e\u0926 a \u0932\u093f\u0916\u093e \u0939\u0948\u0902 \u092f\u093e\u0928\u093f \u0915\u0940 program \u0915\u093e Execution Point \u0938\u0940\u0927\u093e a: \u092a\u0930 \u091a\u0932\u093e \u091c\u093e\u090f\u0917\u093e \u0914\u0930 2 \u092a\u094d\u0930\u093f\u0902\u091f \u0915\u0930\u0947\u0917\u093e \u0964<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php \ngoto&nbsp;a;\necho&nbsp;'1';\n&nbsp;\na:\necho&nbsp;'2';\n?&gt;<\/code><\/pre>\n\n\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">require<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">require &lt;FileName&gt; require \u0915\u0947 \u092c\u093e\u0926 \u092b\u093e\u0907\u0932 \u0915\u093e \u0928\u093e\u092e \u0926\u0947\u0928\u093e \u0939\u094b\u0924\u093e \u0939\u0948\u0902 , \u0939\u092e \u091c\u094b \u092b\u093e\u0907\u0932 require \u0938\u0947 include \u0915\u0930\u0924\u0947 \u0939\u0948 \u0909\u0938\u0915\u093e \u0915\u0902\u091f\u0947\u0902\u091f \u0907\u0938 \u092b\u093e\u0907\u0932 \u092e\u0947\u0902 \u0910\u0921 \u0939\u094b \u091c\u093e\u0924\u093e \u0939\u0948\u0902 , \u0906\u0907\u092f\u0947 \u0938\u092e\u091d\u0924\u0947 \u0939\u0948\u0902 \u0964 \u092f\u0926\u093f \u092b\u093e\u0907\u0932 \u0928\u0939\u0940\u0902 \u092e\u093f\u0932\u0924\u0940 \u0939\u0948\u0902 \u0924\u094b \u092f\u0939 compile Error \u0926\u0947 \u0915\u0930 Execution \u0915\u094b \u0930\u094b\u0915 \u0926\u0947\u0924\u093e \u0939\u0948\u0902 \u0964<\/p>\n\n\n\n<pre title=\"MyFile.php\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\necho \"2&lt;br&gt;\";\n?&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u0939\u092e\u0928\u0947 \u090f\u0915 \u092b\u093e\u0907\u0932 \u092c\u0928\u093e \u0932\u0940 \u091c\u093f\u0938\u092e\u0947 \u0939\u092e\u0928\u0947 2 \u0915\u094b \u092a\u094d\u0930\u093f\u0902\u091f \u0915\u093f\u092f\u093e \u0964<\/p>\n\n\n\n<pre title=\"Test.php\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\necho \"1&lt;br&gt;\";\nrequire 'MyFile.php';\necho \"3&lt;br&gt;\";\n?&gt;<\/code><\/pre>\n\n\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">include<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">include &lt;FileName&gt; Include \u0915\u0947 \u092c\u093e\u0926 \u092b\u093e\u0907\u0932 \u0915\u093e \u0928\u093e\u092e \u0926\u0947\u0928\u093e \u0939\u094b\u0924\u093e \u0939\u0948\u0902 , \u0939\u092e \u091c\u094b \u092b\u093e\u0907\u0932 Include \u0915\u0930\u0924\u0947 \u0939\u0948 \u0909\u0938\u0915\u093e \u0915\u0902\u091f\u0947\u0902\u091f \u0907\u0938 \u092b\u093e\u0907\u0932 \u092e\u0947\u0902 \u0910\u0921 \u0939\u094b \u091c\u093e\u0924\u093e \u0939\u0948\u0902 , \u0906\u0907\u092f\u0947 \u0938\u092e\u091d\u0924\u0947 \u0939\u0948\u0902 \u0964 \u092f\u0926\u093f \u092b\u093e\u0907\u0932 \u0928\u0939\u0940\u0902 \u092e\u093f\u0932\u0924\u0940 \u0939\u0948\u0902 \u0924\u094b warning show \u0939\u094b\u0917\u0940 \u0964<\/p>\n\n\n\n<pre title=\"MyFile.php\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\necho \"2&lt;br&gt;\";\n?&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u0939\u092e\u0928\u0947 \u090f\u0915 \u092b\u093e\u0907\u0932 \u092c\u0928\u093e \u0932\u0940 \u091c\u093f\u0938\u092e\u0947 \u0939\u092e\u0928\u0947 2 \u0915\u094b \u092a\u094d\u0930\u093f\u0902\u091f \u0915\u093f\u092f\u093e \u0964<\/p>\n\n\n\n<pre title=\"Test.php\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">&lt;?php\necho \"1&lt;br&gt;\";\ninclude 'MyFile.php';\necho \"3&lt;br&gt;\";\n?&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u0926\u0947\u0916\u093f\u092f\u0947 \u092f\u0939\u093e\u0901 \u092a\u0930 \u0939\u092e\u0928\u0947 \u090f\u0915 \u092b\u093e\u0907\u0932 \u092c\u0928\u093e\u0908 MyFile.php \u0914\u0930 \u0909\u0938\u092e\u0947 2 Print \u0915\u093f\u092f\u093e \u0939\u0948\u0902 , \u0914\u0930 \u0909\u0938 \u092b\u093e\u0907\u0932 \u0915\u094b Current File \u092e\u0947\u0902 Include \u0915\u093f\u092f\u093e \u0939\u0948\u0902 \u0905\u092c \u091c\u092c output \u092a\u094d\u0930\u093f\u0902\u091f \u0939\u094b\u0917\u093e \u0924\u094b \u0938\u092c\u0938\u0947 \u092a\u0939\u0932\u0947 1 Print \u0939\u094b\u0917\u093e \u0909\u0938\u0915\u0947 \u092c\u093e\u0926 MyFile se 2 \u092a\u094d\u0930\u093f\u0902\u091f \u0939\u094b\u0917\u093e \u0914\u0930 \u092b\u093f\u0930 3 \u092a\u094d\u0930\u093f\u0902\u091f \u0939\u094b\u0917\u093e \u0964<\/p>\n\n\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">require_once<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u0907\u0938\u0915\u093e \u0915\u093e\u0930\u094d\u092f require \u091c\u0948\u0938\u093e \u0939\u0940 \u0939\u0948\u0902 \u092f\u0926\u093f \u0939\u092e\u0928\u0947 \u0938\u094d\u091f\u0947\u091f\u092e\u0947\u0902\u091f \u090f\u0915 \u0938\u0947 \u091c\u094d\u092f\u093e\u0926\u093e \u092c\u093e\u0930 \u0932\u093f\u0916 \u0926\u093f\u092f\u093e \u0939\u094b \u0924\u094b \u092f\u0939 \u0915\u0947\u0935\u0932 \u090f\u0915 \u0939\u0940 \u092c\u093e\u0930 \u092b\u093e\u0907\u0932 \u0915\u094b require \u0915\u0930\u0924\u093e \u0939\u0948\u0902 <\/p>\n\n\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">include_once<\/h2>\n\n\n\n<p class=\"wp-block-zozuk-wphindi\">\u0907\u0938\u0915\u093e \u0915\u093e\u0930\u094d\u092f include \u091c\u0948\u0938\u093e \u0939\u0940 \u0939\u0948\u0902 \u092f\u0926\u093f \u0939\u092e\u0928\u0947 \u0938\u094d\u091f\u0947\u091f\u092e\u0947\u0902\u091f \u090f\u0915 \u0938\u0947 \u091c\u094d\u092f\u093e\u0926\u093e \u092c\u093e\u0930 \u0932\u093f\u0916 \u0926\u093f\u092f\u093e \u0939\u094b \u0924\u094b \u092f\u0939 \u0915\u0947\u0935\u0932 \u090f\u0915 \u0939\u0940 \u092c\u093e\u0930 \u092b\u093e\u0907\u0932 \u0915\u094b include \u0915\u0930\u0924\u093e \u0939\u0948\u0902 <\/p>\n\n\n\n<p><\/p>\n\n\n\n\n\n<hr class=\"wp-block-separator\"\/>\n","protected":false},"excerpt":{"rendered":"<p>Conditional if else elseif\/else if switch Loop while do-while for foreach Jump break continue return goto File require include require_once include_once if else elseif\/else if switch while do-while for foreach break continue return goto require include require_once include_once<\/p>\n","protected":false},"author":1,"featured_media":1627,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1546","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/selfimagination.in\/tips\/wp-content\/uploads\/2021\/07\/php-control-structure.jpg?fit=1200%2C628&ssl=1","_links":{"self":[{"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/posts\/1546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/comments?post=1546"}],"version-history":[{"count":86,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/posts\/1546\/revisions"}],"predecessor-version":[{"id":1635,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/posts\/1546\/revisions\/1635"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/media\/1627"}],"wp:attachment":[{"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/media?parent=1546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/categories?post=1546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/selfimagination.in\/tips\/wp-json\/wp\/v2\/tags?post=1546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}