cvs: phpdoc-ar /language types.xml
[email protected] ("Hafid Benhadria") Fri, 05 Sep 2003 15:28:10 -0000
| Newsgroups | php.doc.ar |
|---|---|
| Message-ID | <cvshafid1062775690@cvsserver> |
hafid Fri Sep 5 11:28:10 2003 EDT
Modified files:
/phpdoc-ar/language types.xml
Log:
4th Partial Translation. Still EN-1.123 compliant.
hafid-20030905112810.txt
(text/plain, 16.1 KB)
Index: phpdoc-ar/language/types.xml
diff -u phpdoc-ar/language/types.xml:1.3 phpdoc-ar/language/types.xml:1.4
--- phpdoc-ar/language/types.xml:1.3 Wed Sep 3 11:27:43 2003
+++ phpdoc-ar/language/types.xml Fri Sep 5 11:28:10 2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-6"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<!-- EN-Revision: 1.123 Maintainer: hafid Status: working -->
<chapter id="language.types">
<title>ÇäÃæèÇÙ</title>
@@ -821,7 +821,7 @@
åæ ÎäÇä âèÓêæ åÙâèáêæ êÍê×Çæ ÈÇäÙÈÇÑÉ.
</simpara>
<sect4 id="language.types.string.parsing.simple">
- <title>ÇäÕñêÚÉ ÇäåÙâÏÉ</title>
+ <title>ÇäÕñêÚÉ ÇäÈÓê×É</title>
<simpara>
ÅÐÇ åÇ ÕèÏá ÑåÒ ÏèäÇÑ (<literal>$</literal>)¬ áÅæñ
ÇäåïáîÓñðÑ êÃÎÐ ÔÇÑÇÊ Èæçå èÈâÏÑ åÇ êÓÊ×êÙ äÊÔãêä
@@ -899,52 +899,52 @@
</simpara>
</sect4>
<sect4 id="language.types.string.parsing.complex">
- <title>Complex (curly) syntax</title>
+ <title>ÇäÕñêÚÉ ÇäåïÙâÏñÉ</title>
<simpara>
- This isn't called complex because the syntax is complex,
- but because you can include complex expressions this way.
+ ÅæñçÇ äÇ ÊïÏÙé åÙâÏÉ äÃæ ÇäÕêÚÉ åÙâÏÉ
+ èÅæñåÇ ÈÓÈÈ Ãæñç¬ ÈçÐç Çä×Ñêâɬ êåãæã ÊÖåêæ ÙÈÇÑÇÊ åÙâÏÉ.
</simpara>
<simpara>
- In fact, you can include any value that is in the namespace
- in strings with this syntax. You simply write the expression
- the same way as you would outside the string, and then include
- it in { and }. Since you can't escape '{', this syntax will
- only be recognised when the $ is immediately following the {.
- (Use "{\$" or "\{$" to get a literal "{$").
- Some examples to make it clear:
+ áê ÇäèÇâÙ¬ êåãæã¬ ÈèÇÓ×É çÐç ÇäÕñêÚɬ ÊÖåêæ ÃêÉ âêåÉ áê åÌÇä ÅÓåêñ
+ áê ÓäÇÓä æÕêñÉ. Ùäêã áâ× Ãæ ÊãÊÈ ÇäÙÈÇÑÉ
+ ÈæáÓ Çä×ÑêâÉ åËäåÇ ÊáÙä äè ãÇæÊ ÎÇÑÌ ÇäÓñäÓäÉ ÇäæñÕêñÉ èåæ Ëå ÊÖåêæçÇ
+ áê { è }. ÈÇÙÊÈÇÑ Ãæñç äÇ êåãæã ÊÃåêæ '{'¬ áÅæñ çÐç ÇäÕñêÚÉ
+ ÓêïÊÙîÑîá ÙäêçÇ áâ× ÙæÏåÇ Êãèæ $ ÊÊÈÙ åÈÇÔÑÉ {.
+ (ÇÓÊÎÏå "{\$" Ãè "\{$" ÈÚÑÖ ÇäÍÕèä Ùäé ÍÑáêÉ "{$").
+ ÈÙÖ ÇäÃåËäÉ äÌÙä ÇäÃåèÑ èÇÖÍÉ:
</simpara>
<informalexample>
<programlisting role="php"><![CDATA[
<?php
-// Let's show all errors
+// äæïØçÑ ãä ÇäÃÎ×ÇÁ
error_reporting(E_ALL);
$great = 'fantastic';
-// Won't work, outputs: This is { fantastic}
+// äæ êÙåä¬ ÇäåïÎÑîÌ: This is { fantastic}
echo "This is { $great}";
-// Works, outputs: This is fantastic
+// êÙåä¬ ÇäåïÎÑîÌ: This is fantastic
echo "This is {$great}";
echo "This is ${great}";
-// Works
+// êÙåä
echo "This square is {$square->width}00 centimeters broad.";
-// Works
+// êÙåä
echo "This works: {$arr[4][3]}";
-// This is wrong for the same reason as $foo[bar] is wrong
-// outside a string. In otherwords, it will still work but
-// because PHP first looks for a constant named foo, it will
-// throw an error of level E_NOTICE (undefined constant).
+// çÐÇ ÎÇׯ äæáÓ ÇäÓÈÈ ÇäÐê êÌÙä $foo[bar] ÎÇׯÇë
+// ÎÇÑÌ ÓäÓäÉ æÕêñÉ. ÈÙÈÇÑÉ ÃÎÑé¬ ÓêØä êÙåä äãæ
+// äÃæñ PHP ÊÈÍË ÃèäÇë Ùæ ËÇÈÊ êïÏÙé foo¬ áÅæçÇ
+// ÊïÕÏðÑï Î×Ãë åæ åÓÊèé E_NOTICE (ËÇÈÊ ÚêÑ åïÙÑñîá).
echo "This is wrong: {$arr[foo][3]}";
-// Works. When using multi-dimensional arrays, always use
-// braces around arrays when inside of strings
+// êÙåä. äãæ ÙæÏ ÇÓÊÎÏÇå åÕáèáÇÊ åÊÙÏÏÉ ÇäÃÈÙÇϬ ÇÍÑÕ Ùäé Ãæ ÊÓÊÎÏå ÏèåÇ
+// ÇäÍÇÖæÊêæ Íèä ÇäåÕáèáÇÊ ÙæÏåÇ Êãèæ ÏÇÎä ÓäÇÓä æÕêñÉ
echo "This works: {$arr['foo'][3]}";
-// Works.
+// êÙåä.
echo "This works: " . $arr['foo'][3];
echo "You can even write {$obj->values[3]->name}";
@@ -962,32 +962,32 @@
</sect4>
</sect3>
<sect3 id="language.types.string.substr">
- <title>String access by character</title>
+ <title>èäèÌ ÓäÓäÉ æÕêñÉ åæ ÎäÇä ÍÑá</title>
<para>
- Characters within strings may be accessed by specifying the
- zero-based offset of the desired character after the string
- in curly braces.
+ êåãæ èäèÌ ÇäÍÑèá ÇäåÊèÇÌÏÉ Öåæ ÇäÓñäÇÓä ÇäæñÕêñÉ åæ ÎäÇä ÊÍÏêÏ
+ ÇäÅÒÇÍÉ ÇäâÇÆåÉ Ùäé ÇäÕñðáÑ èÇäÎÇÕÉ ÈÇäÍÑá ÇäåÑÚèÈ ÈÙÏ ÇäÓñäÓäÉ ÇäæñÕêñÉ
+ Öåæ ÍÇÖæÊêæ åÙâèáÊêæ.
</para>
<note>
<simpara>
- For backwards compatibility, you can still use array-braces
- for the same purpose. However, this syntax is deprecated as
- of PHP 4.
+ äÃÌä ÇäÊñèÇáâ ÇäÊñÑÇÌÙêñ¬ äÇ ÒÇä ÈÅåãÇæã ÇÓÊÎÏÇå ÍÇÖæÇÊ ÇäåÕáèáÇÊ
+ èäÐäã äæáÓ ÇäÚÑÖ. åÙ Ðä㬠áÅæñ çÐç ÇäÕñêÚÉ ÃïçòåðäîÊ ÅÙÊÈÇÑÇë
+ åæ PHP 4.
</simpara>
</note>
<para>
<example>
- <title>Some string examples</title>
+ <title>ÈÙÖ ÇäÃåËäÉ Ùæ ÇäÓñäÇÓä ÇäæñÕêñÉ</title>
<programlisting role="php"><![CDATA[
<?php
-// Get the first character of a string
+// ÇäÍÕèä Ùäé Ãèä ÍÑá áê ÓäÓäÉ æÕêñÉ
$str = 'This is a test.';
$first = $str{0};
-// Get the third character of a string
+// ÇäÍÕèä Ùäé ËÇäË ÍÑá áê ÓäÓäÉ æÕêñÉ
$third = $str{2};
-// Get the last character of a string.
+// ÇäÍÕèä Ùäé ÂÎÑ ÍÑá áê ÓäÓäÉ æÕêñÉ.
$str = 'This is still a test.';
$last = $str{strlen($str)-1};
?>
@@ -998,93 +998,92 @@
</sect2>
<!-- end syntax -->
<sect2 id="language.types.string.useful-funcs">
- <title>Useful functions and operators</title>
+ <title>ÏÇäÇÊ èåïÔîÚðäÇÊ åáêÏÉ</title>
<para>
- Strings may be concatenated using the '.' (dot) operator. Note
- that the '+' (addition) operator will not work for this. Please
- see <link linkend="language.operators.string">String
- operators</link> for more information.
+ êåãæ ÓîäòÓîäîÉ ÇäÓäÇÓä ÇäæñÕêñÉ ÈÇÓÊÎÏÇå åïÔîÚðä '.' (Çäæâ×É). ÇæÊÈç
+ Åäé Ãæñ åïÔîÚðä '+' (ÇäÅÖÇáÉ) äæ êÙåä äçÐÇ ÇäÓÈÈ. ÑÌÇÁë
+ ÇÓÊÙÑÖ <link linkend="language.operators.string">åïÔîÚðäÇÊ
+ ÇäÓñðäÓäÉ ÇäæñîÕêñîÉ</link> èÐäã ääÍÕèä Ùäé åÒêÏ åæ ÇäåÙäèåÇÊ.
</para>
<para>
- There are a lot of useful functions for string modification.
+ çæÇã ÇäãËêÑ åæ ÇäÏèÇä ÇäåáêÏÉ äÃÌä ÊÙÏêä ÇäÓäÇÓä ÇäæÕêñÉ.
</para>
<simpara>
- See the <link linkend="ref.strings">string functions section</link>
- for general functions, the regular expression functions for
- advanced find&replacing (in two tastes:
- <link linkend="ref.pcre">Perl</link> and
- <link linkend="ref.regex">POSIX extended</link>).
+ ÇÓÊÙÑÖ <link linkend="ref.strings">áÕä ÏèÇä ÇäÓäÇÓä ÇäæÕêÉ</link>
+ áêåÇ êÎÕ ÇäÏèÇä ÇäÙÇåÉ èãÐÇ ÏèÇä ÇäÙÈÇÑÉ ÇäÅÙÊêÇÏêñÉ áêåÇ êÎÕ
+ ÇäåêÒÇÊ ÇäåÊâÏåÉ áêåÇ êÊÙäâ ÈÇäÅêÌÇÏ&ÇäÅÓÊÈÏÇä (find&replacing) (áê åØçÑêæ:
+ <link linkend="ref.pcre">Perl</link> è
+ <link linkend="ref.regex">POSIX ÇäåïèîÓñîÙ</link>).
</simpara>
<simpara>
- There are also <link linkend="ref.url">functions for URL-strings</link>,
- and functions to encrypt/decrypt strings
- (<link linkend="ref.mcrypt">mcrypt</link> and
+ çæÇã ÃêÖÇ <link linkend="ref.url">ÏèÇä ääÓäÇÓä ÇäæÕêÉ ÇäÎÇÕÉ ÈåÍÏÏÇÊ ÇäåèÇÑÏ ÇäåÊÔÇãäÉ</link>
+ èÏèÇä äÊÔáêÑ/ÅÒÇäÉ ÊÔáêÑ ÇäÓäÇÓä ÇäæÕêÉ
+ (<link linkend="ref.mcrypt">mcrypt</link> è
<link linkend="ref.mhash">mhash</link>).
</simpara>
<simpara>
- Finally, if you still didn't find what you're looking for,
- see also the <link linkend="ref.ctype">character type functions</link>.
+ áê ÇäÃÎêѬ ÅÐÇ äå ÊÌÏ ÈÙÏ åÇ ÊÈÍË Ùæç¬
+ ÇÓÊÙÑÖ ÃêÖÇ <link linkend="ref.ctype">ÏèÇä ÃæèÇÙ ÇäÍÑèá</link>.
</simpara>
</sect2>
<sect2 id="language.types.string.casting">
- <title>Converting to string</title>
+ <title>ÇäÊÍèêä Åäé ÓäÓäÉ æÕêñÉ</title>
<para>
- You can convert a value to a string using the <literal>(string)</literal>
- cast, or the <function>strval</function> function. String conversion
- is automatically done in the scope of an expression for you where a
- string is needed. This happens when you use the <function>echo</function>
- or <function>print</function> functions, or when you compare a variable
- value to a string. Reading the manual sections on <link linkend="language.types">Types</link> and <link linkend="language.types.type-juggling">Type Juggling</link> will make
- the following clearer. See also <function>settype</function>.
+ êåãæã ÊÍèêä âêåÉ Åäé ÓäÓäÉ æÕêñÉ ÈÇÓÊÎÏÇå ÊÍèêä <literal>(string)</literal>
+ Ãè ÏÇäÉ <function>strval</function>. êÊå ÊÍèêä ÇäÓäÓäÉ ÇäæÕêÉ
+ ÊäâÇÆêÇ Öåæ åÏé ÙÈÇÑÉ åÇ äÃÌäã ÍêËåÇ
+ ÊØçÑ ÇäÍÇÌÉ äÓäÓäÉ æÕêñÉ¿ êÍÏË çÐÇ ÙæÏåÇ ÊÓÊÎÏå ÏèÇä <function>echo</function>
+ Ãè <function>print</function> Ãè ÙæÏåÇ ÊïâÇÑðæ âêåÉ åÊÚêÑ
+ ÈÓäÓäÉ æÕêñÉ. Åæ âÑÇÁÉ áÕèä ÇäÏñäêä ÇäåÊÙäâÉ Èà <link linkend="language.types">ÇäÃæèÇÙ</link> è <link linkend="language.types.type-juggling">ÇäÊñäÇÙÈ ÈÇäÃæèÇÙ</link> ÓêÌÙä
+ åÇ êäê ÃèÖÍ. ÇÓÊÙÑÖ ÃêÖÇ <function>settype</function>.
</para>
<para>
- A <type>boolean</type> &true; value is converted to the string <literal>"1"</literal>,
- the &false; value is represented as <literal>""</literal> (empty string).
- This way you can convert back and forth between boolean and string values.
+ Åæ âêåÉ <type>Çäåæ×âêÉ</type> &true; êÊå ÊÍèêäçÇ Åäé ÇäÓäÓäÉ ÇäæÕêñÉ <literal>"1"</literal>¬
+ ÇäâêåÉ &false; êÊå ÊåËêäçÇ Ùäé Ôãä <literal>""</literal> (ÓäÓäÉ æÕêÉ áÇÑÚÉ).
+ ÈçÐç Çä×Ñêâɬ êåãæã ÇäÊÍèêä¬ ÅâÈÇäÇ èÅÏÈÇÑǬ Èêæ âêå Çäåæ×âêÇÊ èÇäÓñäÇÓä ÇäæñÕêñÉ.
</para>
<para>
- An <type>integer</type> or a floating point number (<type>float</type>)
- is converted to a string representing the number with its digits
- (including the exponent part for floating point numbers).
+ êïÍîèñîä <type>ÙÏÏ ÕÍêÍ</type> Ãè ÙÏÏ Ðê æâ×É ÙÇÆåÉ (<type>ÙÇÆå</type>)
+ Åäé ÓäÓäÉ æÕêñÉ ååËäÇ ÇäÙÏÏ ÈÃÑâÇåç
+ (ÈåÇ áê Ðäã ÇäÌÒÁ ÇäÃÓêñ ÇäÎÇÕ ÈÇäÃÙÏÇÏ ÐÇÊ ÇäæâÇ× ÇäÙÇÆåÉ).
</para>
<para>
- Arrays are always converted to the string <literal>"Array"</literal>,
- so you cannot dump out the contents of an <type>array</type> with
- <function>echo</function> or <function>print</function> to see what is inside
- them. To view one element, you'd do something like <literal>
- echo $arr['foo']</literal>. See below for tips on dumping/viewing the
- entire contents.
+ ÊïÍèñîä ÇäåÕáèáÇÊ ÏÇÆåÇ Åäé ÇäÓäÓäÉ ÇäæÕêÉ <literal>"Array"</literal>¬
+ ÈÍêË äÇ êåãæã ÙÑÖ åÍÊèêÇÊ <type>åÕáèáÉ</type> åÇ ÈèÇÓ×É
+ <function>echo</function> Ãè <function>print</function> ÈÚÑÖ ÇäÅ×äÇÙ Ùäé åÇ ÈÏÇÎäçÇ.
+ ääÅ×äÇÙ Ùäé ÙæÕÑ åǬ Ùäêã Ãæ Êâèå ÈåÇ êÔÈç åÇ êäê: <literal>
+ echo $arr['foo']</literal>. ÇÓÊÙÑÖ åÇ áê ÇäÃÓáä ääÍÕèä Ùäé ÊäåêÍÇÊ ÈÎÕèÕ ÊáÑêÚ/ÙÑÖ
+ ãÇáÉ ÇäåÍÊèêÇÊ.
</para>
<para>
- Objects are always converted to the string <literal>"Object"</literal>.
- If you would like to print out the member variable values of an
- <type>object</type> for debugging reasons, read the paragraphs
- below. If you would like to find out the class name of which an object
- is an instance of, use <function>get_class</function>.
+ ÊïÍèñîä ÇäãÇÆæÇÊ ÏÇÆåÇ Åäé ÇäÓäÓäÉ ÇäæÕêÉ <literal>"Object"</literal>.
+ ÅÐÇ ãæÊ ÊÑÚÈ áê ×ÈÇÙÉ âêå ÇäåÊÚêÑ ÇäÙÖè
+ Èà <type>ãÇÆæ</type> äÃÓÈÇÈ ÊÊÙäâ ÈÅÒÇäÉ ÇäÙää¬ áÇ×äÙ Ùäé ÇäáâÑÇÊ
+ ÇäÓñïáäêñÉ. ÅÐÇ ãæÊ ÊÑÚÈ áê åÙÑáÉ ÅÓå ÇäÕñæá ÇäÐê êÙÊÈÑ ãÇÆæÇ åÇ
+ ÙêñæÉ åæç¬ áÇÓÊÎÏå <function>get_class</function>.
</para>
<para>
- Resources are always converted to strings with the structure
- <literal>"Resource id #1"</literal> where <literal>1</literal> is
- the unique number of the <type>resource</type> assigned by PHP during runtime.
- If you would like to get the type of the resource, use
+ ÊïÍèñîä ÇäåèÇÑÏ ÏèåÇ Åäé ÓäÇÓä æÕêñÉ ÈÇäÈæêÉ
+ <literal>"Resource id #1"</literal> ÍêË êãèæ <literal>1</literal>
+ ÇäÙÏÏ ÇäèÍêÏ äÏé <type>ÇäåèÑÏ</type> èÇäÐê êÊå ÊÙêêæç åæ âÈä PHP ÃËæÇÁ Òåæ ÇäÊñÔÚêä.
+ ÅÐÇ ãæÊ ÊÑÚÈ áê ÇäÍÕèä Ùäé æèÙ ÇäåèÑϬ áÇÓÊÎÏå
<function>get_resource_type</function>.
</para>
<para>
- &null; is always converted to an empty string.
+ ÊïÍèñîä &null; ÏèåÇ Åäé ÓäÓäÉ æÕêñÉ áÇÑÚÉ.
</para>
<para>
- As you can see above, printing out the arrays, objects or resources does not
- provide you any useful information about the values themselfs. Look at the
- functions <function>print_r</function> and <function>var_dump</function>
- for better ways to print out values for debugging.
+ åËäåÇ êåãæã åäÇÍØÊç áê ÇäÃÙäé¬ áÅæ ×ÈÇÙÉ ÇäåÕáèáÇʬ ÇäãÇÆæÇÊ Ãè ÇäåèÇÑÏ äÇ
+ ÊèáÑ äã ÃêÉ åÙäèåÇÊ åáêÏÉ ÈÎÕèÕ Çäâêå áê ÍÏ ÐÇÊçÇ. Ç×äÙ Ùäé
+ ÇäÏñèÇä <function>print_r</function> è <function>var_dump</function>
+ ääÍÕèä Ùäé ×Ñâ ÃåËä ä×ÈÇÙÉ Çäâêå ÇäÎÇÕÉ ÈÅÒÇäÉ ÇäÙää.
</para>
-
<para>
- You can also convert PHP values to strings to store them permanently. This
- method is called serialization, and can be done with the function
- <function>serialize</function>. You can also serialize PHP values to
- XML structures, if you have <link linkend="ref.wddx">WDDX</link> support
- in your PHP setup.
+ êåãæã ÃêÖÇ ÊÍèêä âêå PHP Åäé ÓäÇÓä æÕêñÉ äÊÎÒêæçÇ ÈÔãä ÏÇÆå. çÐÇ
+ ÇäåæçÌ êïÏòÙîé ÈÇäÊñÓäÓä èêåãæ ÅÊåÇåç ÈèÇÓ×É ÇäÏÇäÉ
+ <function>serialize</function>. êåãæã ÃêÖÇ ÌÙä âêå PHP åÊÓäÓäÉ áê Ôãä
+ Èæé XML¬ ÅÐÇ ãÇæ äÏêã ÏÙå äà <link linkend="ref.wddx">WDDX</link>
+ Öåæ ÊæÕêÈ PHP äÏêã.
</para>
</sect2>
<sect2 id="language.types.string.conversion">