Re: how do i remove the first 3 characters from a variable?
| From: | Chris Lambert - WhiteCrown Networks | Date: | Sat, 07 Jul 2001 09:17:34 +0000 |
| Subject: | Re: how do i remove the first 3 characters from a variable? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-56627@lists.php.net to get a copy of this message | ||
To loop:
unset($temp);
$vars = array("this", "that");
foreach ($vars as $var) {
$temp[] = substr($var, 0, 3);
}
$vars = $temp;
Single array element:
$vars = array("this", "that");
$vars[1] = substr($vars[1], 0, 3);
/* Chris Lambert, CTO - chris@whitecrown.net
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/
----- Original Message -----
From: Doron <doron@shevethadar.cjb.net>
To: <php-general@lists.php.net>
Sent: Saturday, July 07, 2001 6:18 AM
Subject: Re: [PHP] how do i remove the first 3 characters from a variable?
| and how do i do that?
|
|
| Maxim Maletsky <maxim@japaninc.com> wrote in message
| news:DC017B079D81D411998C009027B7112A015ED367@EXC-TYO-01...
| > If you loop one then Yes.
| >
| >
| > Sincerely,
| >
| > Maxim Maletsky
| > Founder, Chief Developer
| > PHPBeginner.com (Where PHP Begins)
| > maxim@phpbeginner.com
| > www.phpbeginner.com
| >
| >
| >
| > -----Original Message-----
| > From: Doron [mailto:doron@shevethadar.cjb.net]
| > Sent: Saturday, July 07, 2001 7:06 PM
| > To: php-general@lists.php.net
| > Subject: Re: [PHP] how do i remove the first 3 characters from a
| > variable?
| >
| >
| > does it work on arrays too??
| >
| >
| > Maxim Maletsky <maxim@japaninc.com> wrote in message
| > news:DC017B079D81D411998C009027B7112A015ED364@EXC-TYO-01...
| > >
| > >
| > > php.net/substr
| > >
| > >
| > > $var = "how do i remove the first 3 characters from a variable";
| > > $substract = substr($var, 3);
| > > // returns ' do i remove the first 3 characters from a variable'
| > >
| > >
| > >
| > > Sincerely,
| > >
| > > Maxim Maletsky
| > > Founder, Chief Developer
| > > PHPBeginner.com (Where PHP Begins)
| > > maxim@phpbeginner.com
| > > www.phpbeginner.com
| > >
| > >
| > >
| > >
| > > -----Original Message-----
| > > From: Doron [mailto:doron@shevethadar.cjb.net]
| > > Sent: Saturday, July 07, 2001 5:37 PM
| > > To: php-general@lists.php.net
| > > Subject: [PHP] how do i remove the first 3 characters from a variable?
| > >
| > >
| > > 10x
| > >
| > >
| > >
| > > --
| > > PHP General Mailing List (http://www.php.net/)
| > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
| > > For additional commands, e-mail: php-general-help@lists.php.net
| > > To contact the list administrators, e-mail:
php-list-admin@lists.php.net
| >
| >
| >
| > --
| > PHP General Mailing List (http://www.php.net/)
| > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
| > For additional commands, e-mail: php-general-help@lists.php.net
| > To contact the list administrators, e-mail: php-list-admin@lists.php.net
|
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
| For additional commands, e-mail: php-general-help@lists.php.net
| To contact the list administrators, e-mail: php-list-admin@lists.php.net
|
|
|