Pangrams

  • + 0 comments

    PHP solution

    function pangrams($s) {
        // Write your code here
      $alphabet = 'abcdefghijklmnopqrstuvwxyz';
      $result = true;
      for ($i = 0; $i < strlen($alphabet); $i++) {
        if (strpos(strtolower($s), $alphabet[$i]) === false) {
          $result = false;
          break;
        }
      }
      return $result ? 'pangram' : 'not pangram';
    }