mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-23 22:52:12 +01:00
113 lines
2.9 KiB
XML
113 lines
2.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 0c9c2dd669fe9395eaa73d487fbd160f9057429a Maintainer: leonardolara Status: ready --><!-- CREDITS: felipe,leonardolara -->
|
|
<refentry xml:id="function.is-string" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>is_string</refname>
|
|
<refpurpose>Verifica se o tipo de uma variável é string</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>is_string</methodname>
|
|
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Verifica se o tipo da variável informada é string.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>value</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
A variável a ser analisada.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retorna &true; se <parameter>value</parameter> for do tipo <type>string</type>,
|
|
&false; caso contrário.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemplo de <function>is_string</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$values = array(false, true, null, 'abc', '23', 23, '23.5', 23.5, '', ' ', '0', 0);
|
|
foreach ($values as $value) {
|
|
echo "is_string(";
|
|
var_export($value);
|
|
echo ") = ";
|
|
echo var_dump(is_string($value));
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
is_string(false) = bool(false)
|
|
is_string(true) = bool(false)
|
|
is_string(NULL) = bool(false)
|
|
is_string('abc') = bool(true)
|
|
is_string('23') = bool(true)
|
|
is_string(23) = bool(false)
|
|
is_string('23.5') = bool(true)
|
|
is_string(23.5) = bool(false)
|
|
is_string('') = bool(true)
|
|
is_string(' ') = bool(true)
|
|
is_string('0') = bool(true)
|
|
is_string(0) = bool(false)
|
|
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>is_float</function></member>
|
|
<member><function>is_int</function></member>
|
|
<member><function>is_bool</function></member>
|
|
<member><function>is_object</function></member>
|
|
<member><function>is_array</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</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:"~/.phpdoc/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
|
|
-->
|