Skip to content

Instantly share code, notes, and snippets.

@foru17
Created June 5, 2014 08:36
Show Gist options
  • Save foru17/e23ba1a8a247f7f2c94b to your computer and use it in GitHub Desktop.
Save foru17/e23ba1a8a247f7f2c94b to your computer and use it in GitHub Desktop.
php 的基础 if else 兼容语法
<?php if ($username == 'sally'): ?>
<h3>Hi Sally</h3>
<?php elseif ($username == 'joe'): ?>
<h3>Hi Joe</h3>
<?php else: ?>
<h3>Hi unknown user</h3>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment