note 48258 added to ref.strings

From: Date: Fri, 17 Dec 2004 00:28:11 +0000
Subject: note 48258 added to ref.strings
Groups: php.notes 
Request: Send a blank email to php-notes+get-81879@lists.php.net to get a copy of this message
I don't see anywhere you would convert a string to an array for each character is in it. Why would you do this? the C language treats "string" as an array of "char"'s. This line would be fitting to keep your coding methods the same: for($i=0; $i<strlen($string);$i++) { $Cstring[$i]=substr($string, $i, 1); } Now $Cstring is your "C Like" array string. This is also handy if you need to parse thorugh a string for offset reasons, and substr just doesn't tickel your fancy ---- Manual Page -- http://www.php.net/manual/en/ref.strings.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+48258 Delete -- http://master.php.net/manage/user-notes.php?action=delete+48258&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48258&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48258&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48258&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48258&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48258&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+48258&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#81879) next »