payload: {"action":"opened","issue":{"url":"https://api.github.com/repos/khangufran/php-course/issues/5","repository_url":"https://api.github.com/repos/khangufran/php-course","labels_url":"https://api.github.com/repos/khangufran/php-course/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/khangufran/php-course/issues/5/comments","events_url":"https://api.github.com/repos/khangufran/php-course/issues/5/events","html_url":"https://github.com/khangufran/php-course/issues/5","id":539666683,"node_id":"MDU6SXNzdWU1Mzk2NjY2ODM=","number":5,"title":"Conditional Statements","user":{"login":"github-learning-lab[bot]","id":37936606,"node_id":"MDM6Qm90Mzc5MzY2MDY=","avatar_url":"https://avatars0.githubusercontent.com/in/10572?v=4","gravatar_id":"","url":"https://api.github.com/users/github-learning-lab%5Bbot%5D","html_url":"https://github.com/apps/github-learning-lab","followers_url":"https://api.github.com/users/github-learning-lab%5Bbot%5D/followers","following_url":"https://api.github.com/users/github-learning-lab%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/github-learning-lab%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/github-learning-lab%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github-learning-lab%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/github-learning-lab%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/github-learning-lab%5Bbot%5D/repos","events_url":"https://api.github.com/users/github-learning-lab%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/github-learning-lab%5Bbot%5D/received_events","type":"Bot","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-12-18T13:01:35Z","updated_at":"2019-12-18T13:01:35Z","closed_at":null,"author_association":"NONE","body":"# Conditional Statements\n\n\"If\" statements are one of the most critical procedures in php decision making. They give you control over what is displayed, making the display more dynamic.\n\nAn \"if\" statement tests if a condition is true or false. If true, it will run the code following it. If false, it will skip that code and optionally run code in an \"else\" statement.\n\n## Build your \"if\" statement\n\nWe can use an \"if\" statement to display products we can afford. Let's make another foreach loop, but this time test if the value is less than or equal our credit variable.\n\nAdd the following to the end of your php tag:\n\n```php\necho \"<h2>Items you can afford</h2>\";\n\nforeach($products as $key => $value){\n  if($value <= $credit ){\n  \techo \"<p>\".$key.\"</p>\"; \n  }\n}\n```\n\nRefresh your page, and make sure these products are listed: \"Computer, iPhone, and Toaster\".\n\nYour code should look like this:\n\n```php\n<!DOCTYPE html>\n<html>\n  <head>\n    <title>PHP Store</title>\n  </head>\n  <body>\n    <?php\n\t    $name = \"PHP Store\";\n\t\t\t$credit = 1000; \n\n\t    echo \"<h1>Welcome to \".$name.\"!</h1>\";\n\t    echo \"<h2>You have $\".$credit.\" in your wallet.</h2>\";\n\n\t\t  $products['Computer']=750;\n\t    $products['Car']=15000;\n\t    $products['iPhone']=1000;\n\t    $products['Toaster']=75;\n\n\t    foreach($products as $key => $value){\n\t\t    echo \"<p>The \".$key.\" costs \".$value.\"</p>\";\n\t    }\n\n\t    echo \"<h2>Items you can afford</h2>\";\n\n\t    foreach($products as $key => $value){\n\t\t    if($value <= $credit ){\n\t\t    \techo \"<p>\".$key.\"</p>\"; \n\t\t    }\n\t    }\n    ?>\n  </body>\n</html>\n```\n\nWhen you are finished with this section, push your file to GitHub for the next step:\n\n```\ngit add index.php\ngit commit -m\"add conditional statement\"\ngit push origin master\n```\n"}}
other: {"actor":{"display_login":"github-learning-lab"}}