Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 8602

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Introduction</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="book.ctype.html">Ctype</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="ctype.setup.html">Installing/Configuring</a></div>
 <div class="up"><a href="book.ctype.html">Ctype</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="intro.ctype" class="preface">
  <h1 class="title">Introduction</h1>
  <p class="para">
   The functions provided by this extension check whether a character
   or string falls into a certain character class according to the
   current locale (see also  <span class="function"><a href="function.setlocale.html" class="function">setlocale()</a></span>). 
  </p>
  <p class="para">
   When called with an integer argument these functions 
   behave exactly like their C counterparts from
   <var class="filename">ctype.h</var>.
   It means that if you pass an integer smaller than 256 it will use the
   ASCII value of it to see if it fits in the specified range (digits are in
   0x30-0x39). If the number is between -128 and -1 inclusive then 256 will
   be added and the check will be done on that.
  </p>
  <p class="para">
   When called with a string argument they will check
   every character in the string and will only return
   <strong><code>TRUE</code></strong> if every character in the string matches the
   requested criteria. When called with an empty string 
   the result will always be <strong><code>TRUE</code></strong> in PHP &lt; 5.1 and <strong><code>FALSE</code></strong> since 5.1.
  </p>
  <p class="para">
   Passing anything else but a string or integer will
   return <strong><code>FALSE</code></strong> immediately.
  </p>
  <p class="para">
   It should be noted that ctype functions are always preferred over
   regular expressions, and even to some equivalent <em>&quot;str_*&quot;</em> and <em>&quot;is_*&quot;</em> functions.
   This is because of the fact that ctype uses a native C library and thus
   processes significantly faster.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    These functions are not related to the Python &quot;ctypes&quot; library at all. 
    The extension name stems from the <var class="filename">ctype.h</var> C header
    file that their C equivalents are defined in.
   </p>
   <p class="para">
    This extension also predates Python &quot;ctypes&quot; so any confusion 
    caused by this naming is hardly our fault ...
   </p>
  </p></blockquote>
 </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="book.ctype.html">Ctype</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="ctype.setup.html">Installing/Configuring</a></div>
 <div class="up"><a href="book.ctype.html">Ctype</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>