downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/function.ctype-graph.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/ref.ctype.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'function.ctype-graph.php',
   
1 => 'ctype_graph',
  ),
 
'up' =>
  array (
   
0 => 'ref.ctype.php',
   
1 => 'Ctype Functions',
  ),
 
'prev' =>
  array (
   
0 => 'function.ctype-digit.php',
   
1 => 'ctype_digit',
  ),
 
'next' =>
  array (
   
0 => 'function.ctype-lower.php',
   
1 => 'ctype_lower',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="function.ctype-graph" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ctype_graph</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.4, PHP 5)</p><p class="refpurpose"><span class="refname">ctype_graph</span> &mdash; <span class="dc-title">Check for any printable character(s) except space</span></p>

 </div>

 <a name="function.ctype-graph.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><b>ctype_graph</b></span>
    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$text</tt></span>
   )</div>

  <p class="para rdfs-comment">
   Checks if all of the characters in the provided string,
   <i><tt class="parameter">text</tt></i>
, creates visible output.
  </p>
 </div>


 <a name="function.ctype-graph.parameters"></a><div class="refsect1 parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   </p><dl>

    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">text</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="para">
       The tested string.
      </p>
     </dd>

   
   </dl>
<p>
  </p>
 </div>


 <a name="function.ctype-graph.returnvalues"></a><div class="refsect1 returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <b><tt class="constant">TRUE</tt></b> if every character in <i><tt class="parameter">text</tt></i>
 is
   printable and actually creates visible output (no white space), <b><tt class="constant">FALSE</tt></b>
   otherwise.
  </p>
 </div>


 <a name="function.ctype-graph.examples"></a><div class="refsect1 examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   </p><div class="example">
    <p><b>Example #1 A <b>ctype_graph()</b> example</b></p>
    <div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$strings&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">'string1'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"asdf\n\r\t"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'string2'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'arf12'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'string3'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'LKA#@%.54'</span><span style="color: #007700">);<br />foreach&nbsp;(</span><span style="color: #0000BB">$strings&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$name&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$testcase</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">ctype_graph</span><span style="color: #007700">(</span><span style="color: #0000BB">$testcase</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"The&nbsp;string&nbsp;'</span><span style="color: #0000BB">$name</span><span style="color: #DD0000">'&nbsp;consists&nbsp;of&nbsp;all&nbsp;(visibly)&nbsp;printable&nbsp;characters.\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"The&nbsp;string&nbsp;'</span><span style="color: #0000BB">$name</span><span style="color: #DD0000">'&nbsp;does&nbsp;not&nbsp;consist&nbsp;of&nbsp;all&nbsp;(visibly)&nbsp;printable&nbsp;characters.\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents para"><p>The above example will output:</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
The string &#039;string1&#039; does not consist of all (visibly) printable characters.
The string &#039;string2&#039; consists of all (visibly) printable characters.
The string &#039;string3&#039; consists of all (visibly) printable characters.
</pre></div>
    </div>
   </div><p>
  </p>
 </div>


 <a name="function.ctype-graph.seealso"></a><div class="refsect1 seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   </p><ul class="simplelist">
    <li class="member"><a href="function.ctype-alnum.php" class="function" rel="rdfs-seeAlso">ctype_alnum()</a> - Check for alphanumeric character(s)</li>
    <li class="member"><a href="function.ctype-print.php" class="function" rel="rdfs-seeAlso">ctype_print()</a> - Check for printable character(s)</li>
    <li class="member"><a href="function.ctype-punct.php" class="function" rel="rdfs-seeAlso">ctype_punct()</a> - Check for any printable character which is not whitespace or an
   alphanumeric character</li>
   </ul><p>
  </p>
 </div>

</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites