Re: [PHP-DOC] resources.xml errors
on 27/03/01 22:48, Hojtsy Gabor at [EMAIL PROTECTED] wrote: Hi, > En version is much ugly... I admit it. > There are so many > Useless.. Those are undocumented lines. I left them empty, so as to show there are entries not documented. If you can fill them, feel free. And much more problems... > The texts are not english... Yep, I found some leftover. Just name them to me. the destructor function were not embraced by . This is fixed. However, I don't understand why definition's column (last one) doesn't show up on HTML display. Any clue? And French version is totally missing Do I have to notice it somewhere? Or is it due to heavy errors (like the illegal character stuff?). Here is a new version. Thanks for this feed back. I hope this improved. Damien Seguy.
[PHP-DOC] cvs: phpdoc /en/appendices resources.xml
damsTue Mar 27 23:07:08 2001 EDT Modified files: /phpdoc/en/appendices resources.xml Log: Bug fixes. Should display ok now. Index: phpdoc/en/appendices/resources.xml diff -u phpdoc/en/appendices/resources.xml:1.5 phpdoc/en/appendices/resources.xml:1.6 --- phpdoc/en/appendices/resources.xml:1.5 Tue Mar 27 02:21:02 2001 +++ phpdoc/en/appendices/resources.xml Tue Mar 27 23:07:07 2001 @@ -10,9 +10,9 @@ - Ressource type - Creator - Used int + Resource type's name + Created by + Used by Destroyed by Definition @@ -28,7 +28,9 @@ aspell_check_raw, aspell_suggest -None + + None + Aspell dictionary @@ -44,7 +46,9 @@ bzread, bzwrite -bzclose + + bzclose + Bzip2 file @@ -59,8 +63,10 @@ com_propput, com_set, com_propput + + + None -None COM object reference @@ -127,12 +133,20 @@ cpdf_import_jpeg, cpdf_place_inline_image, cpdf_add_annotation + + + cpdf_close -cpdf_close PDF document with CPDF lib -cpdf outline + cpdf outline + + + + + + curl curl_init @@ -140,8 +154,10 @@ curl_init, curl_exec + + + curl_close -curl_close Curl session @@ -157,8 +173,10 @@ dbmdelete, dbmfirstkey, dbmnextkey + + + dbmclose -dbmclose Link to DBM database @@ -176,8 +194,10 @@ dba_optimize, dba_replace, dba_sync + + + dba_close -dba_close Link to DBA base @@ -196,7 +216,9 @@ dba_replace, dba_sync -None + + None + Persistant link to DBA base @@ -214,14 +236,46 @@ dbase_numfields, dbase_numrecords -dbase_close + + dbase_close + Link to Dbase base -domxml document -domxml node -domxml attribute -xpath context -xpath object + + domxml document + + + + + + + domxml node + + + + + + + domxml attribute + + + + + + + xpath context + + + + + + + xpath object + + + + + fdf @@ -243,7 +297,9 @@ fdf_set_submit_form_action, fdf_set_javascript_action -fdf_close + + fdf_close + FDF File @@ -272,7 +328,9 @@ ftp_delete, ftp_site -ftp_quit + + ftp_quit + FTP stream @@ -322,8 +380,10 @@ imagesx, imagesy, imagettftext + + + imagedestroy -imagedestroy GD Image @@ -335,8 +395,10 @@ imagechar, imagecharup, imagefontheight + + + None -None Font for GD @@ -350,12 +412,20 @@ imagepsextendfont, imagepsencodefont, imagepsbbox + + + imagepsfreefont -imagepsfreefont PS font for GD -gd PS encoding + gd PS encoding + + + + + + hyperwave link gmp_init @@ -398,9 +468,11 @@ gmp_scan1, gmp_popcount, gmp_hamdist + + + None -None -Nombre GMP +GMP Number hyperwave link persistent @@ -448,8 +520,11 @@ hw_unlock, hw_who, hw_getusername + + + hw_close, + hw_free_document -hw_close,hw_free_document Link to Hyperwave server @@ -499,7 +574,9 @@ hw_who, hw_getusername -None + + None + Persistant link to Hyperwave server @@ -531,7 +608,9 @@ hw_pipedocument, hw_unlock -hw_deleteobject + + hw_deleteobject + Hyperwave object @@ -547,7 +626,9 @@ icap_list_alarms, icap_delete_event -icap_close + + icap_close + Link to icap server @@ -593,13 +674,27 @@ imap_msgno, imap_search, imap_fetch_overview + + + imap_close -imap_close Link to IMAP, POP3 serveur -imap chain persistent -ingres + imap chain persistent + + + + + + + ingres + + + + + + ingres persistent ingres_connect @@ -620,8 +715,10 @@ ingres_rollback, ingres_commit, ingres_autocommit + + + ingres_close -ingres_close Persistant link to ingresII base @@ -645,8 +742,10 @@ ingres_rollback, ingres_commit, ingres_autocommit + + + None -None Link to ingresII base @@ -659,8 +758,10 @@ i
[PHP-DOC] Prematurely commited Documentation
Hi there, today I was helping a guy creating PDF's with the PHP extension. He was totally clueless, because he tried to orientate himself via the documentation on www.php.net. As I had a look at the current doc-version, I found out, that the docu implements already the commands for the PDFLib 4.x _beta_ version. Also the example-scripts are the ones from 4.x beta. Personally I deem this a Very Bad Idea [TM], because for using the commands in the examples, a user/developer has a) to use the PHP-CVS (thank god, that fact is made clear on the individual command-docs) and b) has to use the beta version of PDFLib, and that fact is _not_ apparent from the current documentation. I would suggest, that until the status of PDFLib 4.x hasn't changed, you should enable the old docu again, or change this docu to reflect the status of the PDFLib. I just found on the Docu, that you call the command pdf_open depreciated (should be deprecated, shouldn't it?) ...using the current PDFLib 3.03 this is not the case, pdf_open is the appropriate command with this version...so this is not a good idea either! Please have in mind, that I'm no reader of this list, so please reply to my mail address ;-) Regards, Alexander -- | Alexander Wirtz | eMail: [EMAIL PROTECTED]| | web@ctive GmbH| WWW: http://www.web-active.com |
[PHP-DOC] Italian PHP Manual have some ...
... errors. Played just with toye and I have found: [eschmid@toye phpdoc]$ make /usr/bin/jade -d html.dsl -V use-output-dir -t sgml ./phpdocxml.dcl manual.xml /usr/bin/jade:./it/functions/oci8.xml:1201:14:E: end tag for element "simpara" which is not open /usr/bin/jade:./it/functions/oci8.xml:1202:9:E: document type does not allow element "para" here; missing one of "footnote", "msgtext", "caution", "important", "note", "tip", "warning", "blockquote", "informalexample" start-tag /usr/bin/jade:./it/functions/oci8.xml:1236:12:E: document type does not allow element "simpara" here; missing one of "footnote", "msgtext", "caution", "important", "note", "tip", "warning", "blockquote", "informalexample" start-tag /usr/bin/jade:./it/functions/oci8.xml:1241:13:E: end tag for "para" omitted, but OMITTAG NO was specified Luca I hope you know that this means. -Egon -- LinuxTag, Stuttgart, Germany: July 5-8 2001: http://www.linuxtag.de/ All known books about PHP and related books: http://php.net/books.php Concert Band of the University of Hohenheim: http://www.concert-band.de/ First and second bestselling book in German: http://www.php-buch.de/
[PHP-DOC] cvs: phpdoc /en/functions classobj.xml
danbeck Tue Mar 27 13:56:07 2001 EDT Modified files: /phpdoc/en/functionsclassobj.xml Log: changed the version number of get_class_methods note Index: phpdoc/en/functions/classobj.xml diff -u phpdoc/en/functions/classobj.xml:1.18 phpdoc/en/functions/classobj.xml:1.19 --- phpdoc/en/functions/classobj.xml:1.18 Tue Mar 27 10:09:42 2001 +++ phpdoc/en/functions/classobj.xmlTue Mar 27 13:56:06 2001 @@ -347,7 +347,7 @@ - As of PHP 4.0.5, you can specify the object itself instead of + As of PHP 4.0.6, you can specify the object itself instead of class_name. For example:
Re: [PHP-DOC] resources.xml errors
On Tue, Mar 27, 2001 at 10:48:29PM +0200, Hojtsy Gabor wrote: > > > > The file in the $subj is not too well made... There > > > > are much dirty texts in it made by the automated process... > > > > Is it ready for translating? I dont think so... > > > Obviously, the resource.xml in en tree has been infested by > > > French version. I corrected this text. > > > > Look at cvs.php.net if you can resolve the language problem. > > > > > En version is ugly (where is the last column) and French > > > version is even missing!! > > > Egon, help! What happened? > > En version is much ugly... There are so many > > strings... Useless.. And much more problems... > The texts are not english... It is a very alpha version. Nobody is perfect. Damien and I can disable it for a while until it looks more matured. -Egon -- LinuxTag, Stuttgart, Germany: July 5-8 2001: http://www.linuxtag.de/ All known books about PHP and related books: http://php.net/books.php Concert Band of the University of Hohenheim: http://www.concert-band.de/ First and second bestselling book in German: http://www.php-buch.de/
Re: [PHP-DOC] resources.xml errors
> > > The file in the $subj is not too well made... There > > > are much dirty texts in it made by the automated process... > > > Is it ready for translating? I dont think so... > > Obviously, the resource.xml in en tree has been infested by > > French version. I corrected this text. > > Look at cvs.php.net if you can resolve the language problem. > > > En version is ugly (where is the last column) and French > > version is even missing!! > > Egon, help! What happened? En version is much ugly... There are so many strings... Useless.. And much more problems... The texts are not english... Goba ... . . . . . Editor of the Hungarian PHP manual, Admin of the Hungarian PHP mirror
Re: [PHP-DOC] cvs: phpdoc /en/functions classobj.xml
Hi I've been aware of an interesting thread on phpbuilder about the "::" operator. This operator is not yet documented, nor in operator.xml, nor in classobj.xml. This may be a good idea to add this. If this was planned already (some changes seem pretty fresh, aren't they?), just tell me. Here is the URL http://www.phpbuilder.com/annotate/message.php3?id=1002995 Thrad is copied at the end of this mail. Any opinion? Damien Seguy * Message # 1002995: Date: 01/09/01 05:11 By: greggory Subject: RE: Overriding methods Of course it's possible. (With php4 at least :)) As in C++, you use the :: operator. Let's suppose we have a class: class foo { var $x; function foo( $init ) { $this->x = $init; } function print() { echo "X has a value of:$x"; } } And a second class that extends the first one: class doh extends foo { var $y; function doh( $init_x, $init_y ) { foo::foo( $init_x ); $this->y = $init_y; } function print() { echo "Y has a value of:$y"; foo::print(); } } Just try it with a piece of code: $obj1 = new foo( 'Hi!' ); $obj1->print(); $obj2 = new doh( 'world', 'Hello ' ); $obj2->print(); Hope this help. :)
RE: [PHP-DOC] cvs: phpdoc /en/functions classobj.xml
should be 4.0.6 James > -Original Message- > From: Daniel Beckham [mailto:[EMAIL PROTECTED]] > Sent: 27 March 2001 19:10 > To: [EMAIL PROTECTED] > Subject: [PHP-DOC] cvs: phpdoc /en/functions classobj.xml > > > danbeck Tue Mar 27 10:09:43 2001 EDT > > Modified files: > /phpdoc/en/functions classobj.xml > Log: > one last change > > Index: phpdoc/en/functions/classobj.xml > diff -u phpdoc/en/functions/classobj.xml:1.17 > phpdoc/en/functions/classobj.xml:1.18 > --- phpdoc/en/functions/classobj.xml:1.17 Tue Mar 27 10:07:37 2001 > +++ phpdoc/en/functions/classobj.xml Tue Mar 27 10:09:42 2001 > @@ -347,7 +347,7 @@ > > > > - As of PHP 4.0.5, you can specify the class itself instead of > + As of PHP 4.0.5, you can specify the object itself instead of >class_name. For example: > > >
[PHP-DOC] cvs: phpdoc /en/functions classobj.xml
danbeck Tue Mar 27 10:09:43 2001 EDT Modified files: /phpdoc/en/functionsclassobj.xml Log: one last change Index: phpdoc/en/functions/classobj.xml diff -u phpdoc/en/functions/classobj.xml:1.17 phpdoc/en/functions/classobj.xml:1.18 --- phpdoc/en/functions/classobj.xml:1.17 Tue Mar 27 10:07:37 2001 +++ phpdoc/en/functions/classobj.xmlTue Mar 27 10:09:42 2001 @@ -347,7 +347,7 @@ - As of PHP 4.0.5, you can specify the class itself instead of + As of PHP 4.0.5, you can specify the object itself instead of class_name. For example:
Re: [PHP-DOC] cvs: phpdoc /en/functions classobj.xml
On Tue, 27 Mar 2001, Daniel Beckham wrote: > danbeck Tue Mar 27 10:07:37 2001 EDT > > Modified files: > /phpdoc/en/functions classobj.xml > Log: > added note as per Andrei > > Index: phpdoc/en/functions/classobj.xml > diff -u phpdoc/en/functions/classobj.xml:1.16 phpdoc/en/functions/classobj.xml:1.17 > --- phpdoc/en/functions/classobj.xml:1.16 Tue Mar 27 09:33:36 2001 > +++ phpdoc/en/functions/classobj.xml Tue Mar 27 10:07:37 2001 > @@ -345,6 +345,17 @@ > This function returns an array of method names defined for the > class specified by class_name. > > + > + > + As of PHP 4.0.5, you can specify the class itself instead of I would say 'class instance' or 'object'. -Andrei * Non-volatile, random-access, analog memory store... a book. *
[PHP-DOC] cvs: phpdoc /en/functions classobj.xml
danbeck Tue Mar 27 10:07:37 2001 EDT Modified files: /phpdoc/en/functionsclassobj.xml Log: added note as per Andrei Index: phpdoc/en/functions/classobj.xml diff -u phpdoc/en/functions/classobj.xml:1.16 phpdoc/en/functions/classobj.xml:1.17 --- phpdoc/en/functions/classobj.xml:1.16 Tue Mar 27 09:33:36 2001 +++ phpdoc/en/functions/classobj.xmlTue Mar 27 10:07:37 2001 @@ -345,6 +345,17 @@ This function returns an array of method names defined for the class specified by class_name. + + + As of PHP 4.0.5, you can specify the class itself instead of + class_name. For example: + + +$class_methods = get_class_methods($my_class); + + + + get_class_methods example
Re: [PHP-DOC] cvs: phpdoc /en/functions classobj.xml
On Tue, 27 Mar 2001, Daniel Beckham wrote: > Ah, ok.. weird though. Why have two functions that do essentially the same > exact thing? That's just the way it happened. -Andrei "The only true currency in this bankrupt world is what we share with each other when we're uncool." -- Lester Bangs, from the film 'Almost Famous'
Re: [PHP-DOC] cvs: phpdoc /en/functions classobj.xml
Ah, ok.. weird though. Why have two functions that do essentially the same exact thing? Daniel - Original Message - From: "Andrei Zmievski" <[EMAIL PROTECTED]> To: "Daniel Beckham" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, March 27, 2001 11:46 AM Subject: Re: [PHP-DOC] cvs: phpdoc /en/functions classobj.xml > On Tue, 27 Mar 2001, Daniel Beckham wrote: > > Cool, can this be used with get_class_vars() also? If not, it would be a > > logical change to go along with get_class_methods(). > > There is already get_object_vars(). But get_parent_class() got the same > change yesterday. > > -Andrei > * What were the first 15 billion years of the universe like for you? * > >
Re: [PHP-DOC] cvs: phpdoc /en/functions classobj.xml
On Tue, 27 Mar 2001, Daniel Beckham wrote: > Cool, can this be used with get_class_vars() also? If not, it would be a > logical change to go along with get_class_methods(). There is already get_object_vars(). But get_parent_class() got the same change yesterday. -Andrei * What were the first 15 billion years of the universe like for you? *
Re: [PHP-DOC] cvs: phpdoc /en/functions classobj.xml
Cool, can this be used with get_class_vars() also? If not, it would be a logical change to go along with get_class_methods(). Thanks, Daniel - Original Message - From: "Andrei Zmievski" <[EMAIL PROTECTED]> To: "Daniel Beckham" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, March 27, 2001 11:42 AM Subject: Re: [PHP-DOC] cvs: phpdoc /en/functions classobj.xml > On Tue, 27 Mar 2001, Daniel Beckham wrote: > > +$my_class = new myclass(); > > + > > +$class_methods = get_class_methods(get_class($my_class)); > > Since yesterday, you can also do get_class_methods($my_class) directly. > > -Andrei > > "The human brain is a wonderful thing. It starts working the moment you > are born, and never stops until you stand up to speak in public. " -- Sir > George Jessel > >
Re: [PHP-DOC] cvs: phpdoc /en/functions classobj.xml
On Tue, 27 Mar 2001, Daniel Beckham wrote: > +$my_class = new myclass(); > + > +$class_methods = get_class_methods(get_class($my_class)); Since yesterday, you can also do get_class_methods($my_class) directly. -Andrei "The human brain is a wonderful thing. It starts working the moment you are born, and never stops until you stand up to speak in public. " -- Sir George Jessel
[PHP-DOC] cvs: phpdoc /en/functions classobj.xml
danbeck Tue Mar 27 09:33:36 2001 EDT Modified files: /phpdoc/en/functionsclassobj.xml Log: added examples for get_class_* functions Index: phpdoc/en/functions/classobj.xml diff -u phpdoc/en/functions/classobj.xml:1.15 phpdoc/en/functions/classobj.xml:1.16 --- phpdoc/en/functions/classobj.xml:1.15 Tue Mar 27 08:07:03 2001 +++ phpdoc/en/functions/classobj.xmlTue Mar 27 09:33:36 2001 @@ -345,6 +345,51 @@ This function returns an array of method names defined for the class specified by class_name. + + + get_class_methods example + + + + + + + Will produce: + + +myclass +myfunc1 +myfunc2 + + + See also get_class_vars, get_object_vars @@ -367,9 +412,56 @@ string class_name + + This function will return an associative array of default + properties of the class. The resulting array elements are in the + form of varname => value. + + + + Uninitialized class variables will not be reported by + get_class_vars. + + + + + get_class_vars example + + $value) { +echo "$name : $value\n"; +} + +?> + + + - This function will return an array of default properties of the - class. + Will produce: + + +var2 : xyz +var3 : 100 + + See also get_class_methods, @@ -404,6 +496,10 @@ ext/standard/basic_functions.c) and Directory (defined in ext/standard/dir.c). + + + Also note that depending on what libraries you have compiled + into PHP, additional classes could be present.
Re: [PHP-DOC] Generating a single section of docs at a time...
Didn't think about that... thanks! Daniel - Original Message - From: "Egon Schmid (@work)" <[EMAIL PROTECTED]> To: "Daniel Beckham" <[EMAIL PROTECTED]> Cc: "phpdoc" <[EMAIL PROTECTED]> Sent: Tuesday, March 27, 2001 10:39 AM Subject: Re: [PHP-DOC] Generating a single section of docs at a time... > Daniel Beckham wrote: > > > > I know I'm dreaming, but is it possible to only generate a single section of > > the docs at a time when testing changes etc? Sometimes I feel the need to > > actually see what the changes I made look like before I commit them, but it > > takes a very long time to "make html" on my little dev box. I poked around > > the make file, but didn't see any way to do this automagically. Any ideas? > > Edit manual.xml just before the final make. > > -Egon > > -- > SIX Offene Systeme GmbH ·Stuttgart - Berlin > Sielminger Straße 63 ·D-70771 Leinfelden-Echterdingen > Fon +49 711 9909164 · Fax +49 711 9909199 http://www.six.de > Besuchen Sie uns auf der CeBIT 2001, Halle 6, Stand F62/4 > >
Re: [PHP-DOC] Generating a single section of docs at a time...
Daniel Beckham wrote: > > I know I'm dreaming, but is it possible to only generate a single section of > the docs at a time when testing changes etc? Sometimes I feel the need to > actually see what the changes I made look like before I commit them, but it > takes a very long time to "make html" on my little dev box. I poked around > the make file, but didn't see any way to do this automagically. Any ideas? Edit manual.xml just before the final make. -Egon -- SIX Offene Systeme GmbH ·Stuttgart - Berlin Sielminger Straße 63 ·D-70771 Leinfelden-Echterdingen Fon +49 711 9909164 · Fax +49 711 9909199 http://www.six.de Besuchen Sie uns auf der CeBIT 2001, Halle 6, Stand F62/4
[PHP-DOC] Generating a single section of docs at a time...
I know I'm dreaming, but is it possible to only generate a single section of the docs at a time when testing changes etc? Sometimes I feel the need to actually see what the changes I made look like before I commit them, but it takes a very long time to "make html" on my little dev box. I poked around the make file, but didn't see any way to do this automagically. Any ideas? Thanks, Daniel Beckham
[PHP-DOC] cvs: phpdoc /en/functions classobj.xml
danbeck Tue Mar 27 08:07:03 2001 EDT Modified files: /phpdoc/en/functionsclassobj.xml Log: added note to help clarify return type of get_class Index: phpdoc/en/functions/classobj.xml diff -u phpdoc/en/functions/classobj.xml:1.14 phpdoc/en/functions/classobj.xml:1.15 --- phpdoc/en/functions/classobj.xml:1.14 Fri Mar 9 07:33:03 2001 +++ phpdoc/en/functions/classobj.xmlTue Mar 27 08:07:03 2001 @@ -315,6 +315,12 @@ This function returns the name of the class of which the object obj is an instance. + + + get_class returns the class name in + lowercase form. + + See also get_parent_class, is_subclass_of
[PHP-DOC] cvs: phpdoc /fr/functions strings.xml
damsTue Mar 27 07:22:04 2001 EDT Modified files: /phpdoc/fr/functionsstrings.xml Log: Updating strtr example. Index: phpdoc/fr/functions/strings.xml diff -u phpdoc/fr/functions/strings.xml:1.36 phpdoc/fr/functions/strings.xml:1.37 --- phpdoc/fr/functions/strings.xml:1.36Tue Mar 27 03:02:14 2001 +++ phpdoc/fr/functions/strings.xml Tue Mar 27 07:22:04 2001 @@ -646,8 +646,11 @@ - Voir aussi : htmlspecialchars, htmlentities, - strtr et array_flip. + Voir aussi + htmlspecialchars, + htmlentities, + strtr et + array_flip. @@ -3107,8 +3110,10 @@ - Voir aussi ereg_replace, preg_replace - et strtr. + Voir aussi + ereg_replace, + preg_replace et + strtr. @@ -3116,7 +3121,7 @@ strtr - Remplace toutes les occurrences d'un caractère par un autre. + Remplace toutes les occurrences d'un caractère par un autre. @@ -3130,19 +3135,22 @@ - strtr travaille sur str, - remplacant chaque occurence de chaque caractère de la chaîne - from correspondant à la chaîne - to et retourne le résultat. + strtr travaille sur str, + remplacant chaque occurence de chaque caractère de la chaîne + from correspondant à la chaîne + to et retourne le résultat. - Si from et to sont de longueur - différentes, les caractères en trop sont ignorés. + Si from et to sont de longueur + différentes, les caractères en trop sont ignorés. Exemple avec strtr @@ -3166,7 +3174,7 @@ ?> - Cete exemple affichera : "salut à tous, j'ai dit bonjour", + Cet exemple affichera : "salut à tous, j'ai dit bonjour", @@ -3174,7 +3182,8 @@ - Voir aussi ereg_replace. + Voir aussi + ereg_replace.
[PHP-DOC] cvs: phpdoc /fr/functions array.xml
damsTue Mar 27 06:11:30 2001 EDT Modified files: /phpdoc/fr/functionsarray.xml Log: Added array_reduce, map and filter. Index: phpdoc/fr/functions/array.xml diff -u phpdoc/fr/functions/array.xml:1.27 phpdoc/fr/functions/array.xml:1.28 --- phpdoc/fr/functions/array.xml:1.27 Mon Mar 19 09:01:14 2001 +++ phpdoc/fr/functions/array.xml Tue Mar 27 06:11:28 2001 @@ -217,11 +217,67 @@ + + +array_filter +Filtre les éléments d'un tableau + + +Description + + + array array_filter + array input + mixed + callback + + + + + array_filter retourne un tableau + contenant les éléments du tableau input, + filtré grâce à la fonction callback. + Si input est un tableau associatif, + les clés sont préservées. + + + + Exemple avec array_filter + +1, "b"=>2, "c"=>3, "d"=>4, "e"=>5); +$array2 = array(6, 7, 8, 9, 10, 11, 12); +$tableau_pair = array_filter($array1, "pair"); +$tableau_impair = array_filter($array2, "impair"); +?> + + + + + Cet exemple montre comment extraire les nombres pairs + dans $tableau_impair : ce dernier contient + array ("a"=>1, "c"=>3, "e"=>5);, + et les nombres impairs dans $tableau_pair : + ce dernier contient array (6, 8, 10, 12);, + + + Voir aussi + array_map et + array_reduce. + + + array_flip - Remplace les clés par les valeurs, et les valeurs par les clés + Remplace les clés par les valeurs, et les valeurs par les clés @@ -370,10 +426,183 @@ - Voir aussi array_values. + Voir aussi + array_values. + + +array_map +Applique sur fonction sur des tableaux + + +Description + + + array array_map + mixed callback + array arr1 + array + arr2... + + + + + array_map retourne un tableau + contenant tous les éléments du tableau arr1, + après leur avoir appliqué la fonction +callback. + Le nombre de paramètre de la fonction callback + doit être égal au nombre de tableaux passés dans la fonction + array_map. + + + + Exemple avec array_map + + + + + + + Avec cet exemple, la variable $b contiendra + array (1, 8, 27, 64, 125);. + + + + array_filter - utilisation de plusieurs +tableaux + + $m); +} +$a = array(1, 2, 3, 4, 5); +$b = array("uno", "dos", "tres", "cuatro", "cinco"); +$c = array_map("parle_espagnol", $a, $b); +print_r($c); +// Affichera : +// Array +// ( +// [0] => Le nombre 1 se dit uno en espagnol +// [1] => Le nombre 2 se dit dos en espagnol +// [2] => Le nombre 3 se dit tres en espagnol +// [3] => Le nombre 4 se dit cuatro en espagnol +// [4] => Le nombre 5 se dit cinco en espagnol +// ) +$d = array_map("map_espagnol", $a , $b); +print_r($d); +// Affichera : +// Array +// ( +// [0] => Array +// ( +// [1] => uno +// ) +// +// [1] => Array +// ( +// [2] => dos +// ) +// +// [2] => Array +// ( +// [3] => tres +// ) +// +// [3] => Array +// ( +// [4] => cuatro +// ) +// +// [4] => Array +// ( +// [5] => cinco +// ) +// +// ) +?> + + + + + Généralement, lorsque vous utilisez plusieurs tableaux, ils doivent + être de même longueur, car la fonction de callback est +appliqué à + un élément de chaque tableau. Si les tableaux sont de taille +inégale, + les plus courts seront remplis d'éléments vides. + + + Une utilisation interessante de cette fonction est de construire des + tableaux de tableaux, grâce à la fonction de callback +null. + + + + array_map - création d'un tableau de +tableaux + + Array +// ( +// [0] => 1 +// [1] => un +// [2] => uno +// ) +// +// [1] => Array +// ( +// [0] => 2 +// [1] => deux +// [2] => dos +// ) +// +// [2] => Array +// ( +// [0] => 3 +//
[PHP-DOC] cvs: phpdoc /en/functions array.xml
jmcastagnetto Tue Mar 27 04:57:20 2001 EDT Modified files: /phpdoc/en/functionsarray.xml Log: documentation of array_filter, array_map, and array_reduce Index: phpdoc/en/functions/array.xml diff -u phpdoc/en/functions/array.xml:1.61 phpdoc/en/functions/array.xml:1.62 --- phpdoc/en/functions/array.xml:1.61 Fri Mar 16 22:14:56 2001 +++ phpdoc/en/functions/array.xml Tue Mar 27 04:57:19 2001 @@ -200,6 +200,62 @@ + + +array_filter +Filters elements of an array using a callback function + + +Description + + + array array_filter + array input + mixed + callback + + + + + Array_filter returns an array + containing all the elements of input + filtered according a callback function. If the + input is an associative array + the keys are preserved. + + + + Array_filter example + +function odd($var) { + return ($var % 2 == 1); +} + +function even($var) { + return ($var % 2 == 0); +} + +$array1 = array ("a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5); +$array2 = array (6, 7, 8, 9, 10, 11, 12); + +$odd_arr = array_filter($array1, "odd"); +$even_arr = array_filter($array2, "even"); + + + + + This makes $odd_arr have + array ("a"=>1, "c"=>3, "e"=>5);, + and $even_arr have + array (6, 8, 10, 12);, + + + See also array_map, + array_reduce. + + + + array_flip @@ -342,6 +398,184 @@ + + +array_map +Applies the callback to the elements of the given arrays + + +Description + + + array array_map + mixed callback + array arr1 + array + arr2... + + + + + Array_map returns an array + containing all the elements of arr1 + after applying the callback function to each one. + The number of parameters that the callback function accepts should + match the number of arrays passed to the array_map + + + + Array_map example + +function cube($n) { + return $n*$n*$n; +} + +$a = array(1, 2, 3, 4, 5); +$b = array_map("cube", $a); + + + + + This will result in $b containing + array (1, 8, 27, 64, 125); + + + + Array_filter - using more arrays + +function show_Spanish($n, $m) { + return "The number $n is called $m in Spanish"; +} + +function map_Spanish($n, $m) { + return array ($n => $m); +} + +$a = array(1, 2, 3, 4, 5); +$b = array("uno", "dos", "tres", "cuatro", "cinco"); + +$c = array_map("show_Spanish", $a, $b); + +print_r($c); + +// will output: +// Array +// ( +// [0] => The number 1 is called uno in Spanish +// [1] => The number 2 is called dos in Spanish +// [2] => The number 3 is called tres in Spanish +// [3] => The number 4 is called cuatro in Spanish +// [4] => The number 5 is called cinco in Spanish +// ) + +$d = array_map("map_Spanish", $a , $b); + +print_r($d); + +// will output: +// Array +// ( +// [0] => Array +// ( +// [1] => uno +// ) +// +// [1] => Array +// ( +// [2] => dos +// ) +// +// [2] => Array +// ( +// [3] => tres +// ) +// +// [3] => Array +// ( +// [4] => cuatro +// ) +// +// [4] => Array +// ( +// [5] => cinco +// ) +// +// ) + + + + + Usually when using two or more arrays, they should be of equal length + because the callback function is applied in parallel to the corresponding + elements. + If the arrays are of unequal length, the shortest one will be extended + with empty elements. + + + An interesting use of this function is to construct an array of arrays, + which can be easily performed by using null + as the name of the callback function + + + + Array_map - creating an array of arrays + +$a = array(1, 2, 3, 4, 5); +$b = array("one", "two", "three", "four", "five"); +$c = array("uno", "dos", "tres", "cuatro", "cinco"); + +$d = array_map(null, $a, $b, $c); +print_r($d); + +// will output: +// Array +// ( +// [0] => Array +// ( +// [0] => 1 +// [1] => one +// [2] => uno +// ) +// +// [1] => Array +// ( +// [0] => 2 +// [1] => two +// [2] => dos +// ) +// +// [2] => Array +// ( +// [0] => 3 +// [1] => three +// [2] => tres +// ) +// +// [3] => Array +// ( +// [0] => 4 +// [1] => four +// [2] => cuatro +// ) +// +// [4] => Array +// ( +// [0] => 5 +// [1] => five +// [2] => cinco +// ) +// +// ) + + +
[PHP-DOC] cvs: phpdoc /fr/language operators.xml
damsTue Mar 27 03:03:12 2001 EDT Modified files: /phpdoc/fr/language operators.xml Log: Corrected some @ Index: phpdoc/fr/language/operators.xml diff -u phpdoc/fr/language/operators.xml:1.10 phpdoc/fr/language/operators.xml:1.11 --- phpdoc/fr/language/operators.xml:1.10 Thu Feb 1 05:42:48 2001 +++ phpdoc/fr/language/operators.xmlTue Mar 27 03:03:12 2001 @@ -48,36 +48,36 @@ - L'opérateur de division ("/") retourne une valeur entière - (le résultat d'une division entière) si les deux opérandes - sont entiers (ou bien des chaînes converties en entiers. - Si l'un des opérandes est un nombre à virgule flottante, - ou bien le résultat d'une opération qui retourne une valeur - non entière, un nombre à virgule flottante sera retourné. + L'opérateur de division ("/") retourne une valeur entière + (le résultat d'une division entière) si les deux opérandes + sont entiers (ou bien des chaînes converties en entiers. + Si l'un des opérandes est un nombre à virgule flottante, + ou bien le résultat d'une opération qui retourne une valeur + non entière, un nombre à virgule flottante sera retourné. Les opérateurs d'assignement - L'opérateurs d'assignement le plus simple est le signe "=". - Le premier réflexe est de penser que ce signe veut dire - "égal à". Ce n'est pas le cas. Il signifie que - l'opérande de gauche se voit affecter la valeur de - l'expression qui est à droite du signe égal. + L'opérateurs d'assignement le plus simple est le signe "=". + Le premier réflexe est de penser que ce signe veut dire + "égal à". Ce n'est pas le cas. Il signifie que + l'opérande de gauche se voit affecter la valeur de + l'expression qui est à droite du signe égal. - La valeur d'une expression d'assignement est la valeur - assignée. Par exemple, la valeur de l'expression - '$a = 3' est la valeur 3. Cela permet de faire d'utiliser - des astuces telles que : - - + La valeur d'une expression d'assignement est la valeur + assignée. Par exemple, la valeur de l'expression + '$a = 3' est la valeur 3. Cela permet de faire d'utiliser + des astuces telles que : + + - - - + + + En plus du simple opérateur d'assignement, il existe des "opérateurs combinés" pour tous les opérateurs @@ -262,42 +262,44 @@ Opérateur de contrôle d'erreur -PHP supporte un opératuer de contrôle d'erreur : c'est @. Lorsque cet -opérateur est ajouté en préfixe d'une expression PHP, les messages -d'erreur qui peuvent être générés par cette expression seront -ignorés. +PHP supporte un opérateur de contrôle d'erreur : c'est @. +Lorsque cet opérateur est ajouté en préfixe d'une +expression PHP, les messages d'erreur qui peuvent être +générés par cette expression seront ignorés. Si l'option track_errors -est activée, les messages d'erreurs générés une expression seront -sauvé dans la variable globale $php_errormsg. Cette variable -sera écrasée à chaque erreur. Il faut alors la surveiller souvent -pour pouvoir l'utiliser. +est activée, les messages d'erreurs générés +par une expression seront sauvés dans la variable globale +$php_errormsg. Cette variable sera écrasée à +chaque erreur. Il faut alors la surveiller souvent pour pouvoir l'utiliser. -Voir aussi error_reporting. +Voir aussi +error_reporting. Opérateur d'exécutions - PHP supporte un opérateur d'exécution : guillemets obliques ("``"). - Notez bien la différence avec les guillemets simples (sur la touche - 4), et ceux-ci (sur la touche de la livre anglaise). PHP essaiera + PHP supporte un opérateur d'exécution : guillemets obliques + ("``"). Notez bien la différence avec les guillemets simples (sur + la touche 4), et ceux-ci (sur la touche de la livre anglaise). PHP essaiera d'exécuter le contenu de ces guillemets obliques comme une commande - shell. Le résultat sera retourné (i.e. : il ne sera pas simplement - envoyé à la sortie standard, il peut être assigné à une variable). + shell. Le résultat sera retourné (i.e. : il ne sera pas + simplement envoyé à la sortie standard, il peut être + assigné à une variable).
[PHP-DOC] cvs: phpdoc /fr/functions filesystem.xml info.xml regex.xml strings.xml
damsTue Mar 27 03:02:15 2001 EDT Modified files: /phpdoc/fr/functionsinfo.xml regex.xml strings.xml filesystem.xml Log: Latest updates. Index: phpdoc/fr/functions/info.xml diff -u phpdoc/fr/functions/info.xml:1.13 phpdoc/fr/functions/info.xml:1.14 --- phpdoc/fr/functions/info.xml:1.13 Mon Mar 19 09:01:14 2001 +++ phpdoc/fr/functions/info.xmlTue Mar 27 03:02:14 2001 @@ -1500,12 +1500,12 @@ Affichage des fichirs inclus et requis Index: phpdoc/fr/functions/regex.xml diff -u phpdoc/fr/functions/regex.xml:1.9 phpdoc/fr/functions/regex.xml:1.10 --- phpdoc/fr/functions/regex.xml:1.9 Mon Mar 12 04:14:00 2001 +++ phpdoc/fr/functions/regex.xml Tue Mar 27 03:02:14 2001 @@ -183,7 +183,7 @@ string sera retournée intacte. - Par exemple, le code suivant affiche "Ceci est un test" trois fois : + Par exemple, le code suivant affiche "Ceci etait un test" trois fois : Exemple avec ereg_replace Index: phpdoc/fr/functions/strings.xml diff -u phpdoc/fr/functions/strings.xml:1.35 phpdoc/fr/functions/strings.xml:1.36 --- phpdoc/fr/functions/strings.xml:1.35Wed Mar 21 03:04:23 2001 +++ phpdoc/fr/functions/strings.xml Tue Mar 27 03:02:14 2001 @@ -2049,7 +2049,7 @@ strchr - Recherche la première occurrence d'un caractère. + Renvoie la chaîne à partir de la première occurence @@ -2602,12 +2602,12 @@ - affichera "2". + affichera "2", car "42" est la plus longue chaîne contenant + des chiffres dans la chaîne de question. - Voir aussi strcspn. + Voir aussi + strcspn. @@ -2858,7 +2860,8 @@ strstr - Renvoie la chaîne à partir de la première occurence + Renvoie la chaîne à partir de la première occurence + Description Index: phpdoc/fr/functions/filesystem.xml diff -u phpdoc/fr/functions/filesystem.xml:1.17 phpdoc/fr/functions/filesystem.xml:1.18 --- phpdoc/fr/functions/filesystem.xml:1.17 Mon Mar 19 09:01:14 2001 +++ phpdoc/fr/functions/filesystem.xml Tue Mar 27 03:02:14 2001 @@ -701,14 +701,15 @@ filename existe, et FALSE sinon. - file_exists ne fonctionne pas sur les fichiers distants. + file_exists ne fonctionne pas sur les + fichiers distants. Les fichiers doivent être accessibles par le système de fichier du serveur. - Le résultat de file_exists est mis en cache. - Reportez-vous à clearstatcache pour - plus de détails. + Le résultat de file_exists est mis en cache. + Reportez-vous à clearstatcache pour + plus de détails. @@ -729,11 +730,17 @@ - fileatime renvoie la date à laquelle le fichier - a été accédé pour la dernière fois, ou - FALSE en cas d'erreur. + fileatime renvoie la date à laquelle le fichier + a été accédé pour la dernière fois, ou + FALSE en cas d'erreur. + fileatime ne fonctionne pas sur les + fichiers distants. + Les fichiers doivent être accessibles par le système de fichier + du serveur. + + Le résultat de fileatime est mis en cache. Reportez vous à clearstatcache pour plus de détails. @@ -744,8 +751,8 @@ filectime - Renvoie l'heure à laquelle l'inode a été - accédé pour la dernière fois. + Renvoie l'heure à laquelle l'inode a été + accédé pour la dernière fois. @@ -757,14 +764,35 @@ - filectime renvoie l'heure à laquelle l'inode - filename a été accédé pour - la dernière fois, ou FALSE en cas d'erreur. + filectime renvoie l'heure à laquelle l'inode + filename a été accédé pour + la dernière fois, ou FALSE en cas d'erreur. + +
Re: [PHP-DOC] resources.xml errors
Damien Seguy wrote: > > on 26/03/01 22:25, Hojtsy Gabor at [EMAIL PROTECTED] wrote: > > The file in the $subj is not too well made... There > > are much dirty texts in it made by the automated process... > > Is it ready for translating? I dont think so... > Obviously, the resource.xml in en tree has been infested by > French version. I corrected this text. Look at cvs.php.net if you can resolve the language problem. > En version is ugly (where is the last column) and French > version is even missing!! > Egon, help! What happened? I don't know and I have today not so many free time. -Egon -- SIX Offene Systeme GmbH ·Stuttgart - Berlin Sielminger Straße 63 ·D-70771 Leinfelden-Echterdingen Fon +49 711 9909164 · Fax +49 711 9909199 http://www.six.de Besuchen Sie uns auf der CeBIT 2001, Halle 6, Stand F62/4
[PHP-DOC] cvs: phpdoc /en/appendices resources.xml
damsTue Mar 27 02:21:03 2001 EDT Modified files: /phpdoc/en/appendices resources.xml Log: Corrected title. Index: phpdoc/en/appendices/resources.xml diff -u phpdoc/en/appendices/resources.xml:1.4 phpdoc/en/appendices/resources.xml:1.5 --- phpdoc/en/appendices/resources.xml:1.4 Mon Mar 26 12:06:45 2001 +++ phpdoc/en/appendices/resources.xml Tue Mar 27 02:21:02 2001 @@ -1,5 +1,5 @@ - Ressource types of PHP + PHP's resource types Here is the function's list which create, use or destroy PHP resources. You know when a variable is a resource
Re: [PHP-DOC] resources.xml errors
on 26/03/01 22:25, Hojtsy Gabor at [EMAIL PROTECTED] wrote: > Hi! Hi, > The file in the $subj is not too well made... There > are much dirty texts in it made by the automated process... > Is it ready for translating? I dont think so... Obviously, the resource.xml in en tree has been infested by French version. I corrected this text. En version is ugly (where is the last column) and French version is even missing!! Egon, help! What happened? Translation should be ok. Thanks Goba for those en's typos. Damien Seguy.