note 39354 deleted from function.substr by nlopess
| From: | nlopess@php.net | Date: | Sat, 03 Jul 2004 12:05:59 +0000 |
| Subject: | note 39354 deleted from function.substr by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-72410@lists.php.net to get a copy of this message | ||
Note Submitter: Matt
----
For those of you who are used to Java:
<?
// string substring(string str, int start, int end)
function substring($str, $start, $end) {
$subset = substr($str, $start, ((strlen($str)-2)-$end));
return $subset;
}
/*
In Java, the end is the last index number minus 1 to go to.
To be more specific on use:
string substring(string str, int beginIndex, int endIndex)
*/