2002-05-02 13:22:42 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2003-05-30 12:04:48 +00:00
|
|
|
<!-- $Revision: 1.4 $ -->
|
2002-05-02 13:22:42 +00:00
|
|
|
<refentry id="function.token-get-all">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>token_get_all</refname>
|
2003-02-06 09:38:26 +00:00
|
|
|
<refpurpose>Split given source into PHP tokens</refpurpose>
|
2002-05-02 13:22:42 +00:00
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
2003-02-06 09:38:26 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>array</type><methodname>token_get_all</methodname>
|
|
|
|
<methodparam><type>string</type><parameter>source</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
|
|
<function>token_get_all</function> parses the given <parameter>source</parameter>
|
|
|
|
string into PHP language tokens using the Zend engines lexical scanner.
|
|
|
|
The function returns an array of token descriptions. Each array element itself is
|
|
|
|
either a one character string or itself an array containing a token id and the
|
|
|
|
string representation of that token in the source code.
|
|
|
|
</para>
|
2003-02-06 15:07:51 +00:00
|
|
|
<example>
|
2003-05-30 12:04:48 +00:00
|
|
|
<title><function>token_get_all</function> example</title>
|
2003-02-06 09:38:26 +00:00
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
<?php
|
2003-05-30 12:04:48 +00:00
|
|
|
$tokens = token_get_all(";"); // => array(";")
|
|
|
|
$tokens = token_get_all("foreach"); // => array(T_FOREACH => "foreach")
|
|
|
|
$tokens = token_get_all("/* comment */"); // => array(T_ML_COMMENT => "/* comment */")
|
2003-02-06 09:38:26 +00:00
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
2003-02-06 15:07:51 +00:00
|
|
|
</example>
|
2002-05-02 13:22:42 +00:00
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|