From 7121f8ca41eaa1e128e6215a0fdb1cd0ad1ca614 Mon Sep 17 00:00:00 2001 From: Nitin Sharma <31216614+nitin7ind@users.noreply.github.com> Date: Sun, 14 Oct 2018 21:40:03 +0530 Subject: [PATCH] Added Nested case and updated ElseIf statement. (#18465) Added the nested If/Else case. Added the missing condition if ElseIf block. --- .../english/php/if-else-statement/index.md | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/client/src/pages/guide/english/php/if-else-statement/index.md b/client/src/pages/guide/english/php/if-else-statement/index.md index f5386070f7..cae0c8bb2a 100644 --- a/client/src/pages/guide/english/php/if-else-statement/index.md +++ b/client/src/pages/guide/english/php/if-else-statement/index.md @@ -27,17 +27,40 @@ If/Else is a conditional statement where depending on the truthiness of a condit ~~~~ ## If/Elseif/Else Statement ~~~~ - if (condition){ + if (condition1){ statement1; statement2; } - elseif{ + elseif (condition2){ statement3; statement4; } else statement5; ~~~~ +## Nested If/Else Statement +~~~~ + if (condition1){ + if (condition2){ + statement1; + statement2; + } + else{ + statement3; + statement4; + } + } + else { + if (condition3){ + statement5; + statement6; + } + else{ + statement7; + statement8; + } + } +~~~~ For more information check out the following link: PHP Else