Posted By

paulgrenwood on 09/23/09


php isset strlen

Versions (?)

isset instead of strlen

 / Published in: PHP

This snippet uses isset() instead strlen() to verify a PHP variable (in this example $username) is set and is at least six characters long.

  1. <?php
  2. if (isset($username[5])) {
  3. // Do something...
  4. }
  5. ?>

Report this snippet  

You need to login to post a comment.