[PHP] how do i remove the first 3 characters from a variable?

2001-07-07 Thread Doron

10x



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] how do i remove the first 3 characters from a variable

2001-07-07 Thread Don Read


On 07-Jul-01 Doron wrote:
 10x
 

12x  10x; I win.

Normally the question is presented in the message text.
  (yure not from 'round here, areya ?)

.
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] how do i remove the first 3 characters from a variable?

2001-07-07 Thread Doron

and how do i do that?


Maxim Maletsky [EMAIL PROTECTED] 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)
  [EMAIL PROTECTED]
  www.phpbeginner.com



 -Original Message-
 From: Doron [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, July 07, 2001 7:06 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] how do i remove the first 3 characters from a
 variable?


 does it work on arrays too??


 Maxim Maletsky [EMAIL PROTECTED] 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)
   [EMAIL PROTECTED]
   www.phpbeginner.com
 
 
 
 
  -Original Message-
  From: Doron [mailto:[EMAIL PROTECTED]]
  Sent: Saturday, July 07, 2001 5:37 PM
  To: [EMAIL PROTECTED]
  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: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] how do i remove the first 3 characters from a variable?

2001-07-07 Thread Chris Lambert - WhiteCrown Networks

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 - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: Doron [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED] 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)
|   [EMAIL PROTECTED]
|   www.phpbeginner.com
| 
| 
| 
|  -Original Message-
|  From: Doron [mailto:[EMAIL PROTECTED]]
|  Sent: Saturday, July 07, 2001 7:06 PM
|  To: [EMAIL PROTECTED]
|  Subject: Re: [PHP] how do i remove the first 3 characters from a
|  variable?
| 
| 
|  does it work on arrays too??
| 
| 
|  Maxim Maletsky [EMAIL PROTECTED] 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)
|[EMAIL PROTECTED]
|www.phpbeginner.com
|  
|  
|  
|  
|   -Original Message-
|   From: Doron [mailto:[EMAIL PROTECTED]]
|   Sent: Saturday, July 07, 2001 5:37 PM
|   To: [EMAIL PROTECTED]
|   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: [EMAIL PROTECTED]
|   For additional commands, e-mail: [EMAIL PROTECTED]
|   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
| 
| 
| 
|  --
|  PHP General Mailing List (http://www.php.net/)
|  To unsubscribe, e-mail: [EMAIL PROTECTED]
|  For additional commands, e-mail: [EMAIL PROTECTED]
|  To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] how do i remove the first 3 characters from a variable?

2001-07-07 Thread Doron

does it work on arrays too??


Maxim Maletsky [EMAIL PROTECTED] 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)
  [EMAIL PROTECTED]
  www.phpbeginner.com




 -Original Message-
 From: Doron [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, July 07, 2001 5:37 PM
 To: [EMAIL PROTECTED]
 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] how do i remove the first 3 characters from a variable?

2001-07-07 Thread PHPBeginner.com



I think your question was answered already by Chris,
if not (or if you think two examples are better then one) then:



$array[0] = 'how do i remove the first 3 characters from a variable?';
$array[1] = 'when do i remove the first 3 characters from a variable?';
$array[2] = 'why do i remove the first 3 characters from a variable?';


foreach($array as $key=$val) {
$array[$key] = substr($array[$key], 3);
}

this will produce:

$array[0] = ' do i remove the first 3 characters from a variable?';
$array[1] = 'n do i remove the first 3 characters from a variable?';
$array[2] = ' do i remove the first 3 characters from a variable?';




Cheers,


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Chris Lambert - WhiteCrown Networks [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 07, 2001 6:18 PM
To: Doron
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] how do i remove the first 3 characters from a
variable?


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 - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: Doron [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED] 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)
|   [EMAIL PROTECTED]
|   www.phpbeginner.com
| 
| 
| 
|  -Original Message-
|  From: Doron [mailto:[EMAIL PROTECTED]]
|  Sent: Saturday, July 07, 2001 7:06 PM
|  To: [EMAIL PROTECTED]
|  Subject: Re: [PHP] how do i remove the first 3 characters from a
|  variable?
| 
| 
|  does it work on arrays too??
| 
| 
|  Maxim Maletsky [EMAIL PROTECTED] 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)
|[EMAIL PROTECTED]
|www.phpbeginner.com
|  
|  
|  
|  
|   -Original Message-
|   From: Doron [mailto:[EMAIL PROTECTED]]
|   Sent: Saturday, July 07, 2001 5:37 PM
|   To: [EMAIL PROTECTED]
|   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: [EMAIL PROTECTED]
|   For additional commands, e-mail: [EMAIL PROTECTED]
|   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
| 
| 
| 
|  --
|  PHP General Mailing List (http://www.php.net/)
|  To unsubscribe, e-mail: [EMAIL PROTECTED]
|  For additional commands, e-mail: [EMAIL PROTECTED]
|  To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] how do i remove the first 3 characters from a variable?

2001-07-07 Thread PHPBeginner.com

oops


foreach($array as $key=$val) {
$array[$key] = substr($val, 3);
}


this is cleaner.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: PHPBeginner.com [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 07, 2001 10:56 PM
To: Chris Lambert - WhiteCrown Networks; Doron
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] how do i remove the first 3 characters from a
variable?




I think your question was answered already by Chris,
if not (or if you think two examples are better then one) then:



$array[0] = 'how do i remove the first 3 characters from a variable?';
$array[1] = 'when do i remove the first 3 characters from a variable?';
$array[2] = 'why do i remove the first 3 characters from a variable?';


foreach($array as $key=$val) {
$array[$key] = substr($array[$key], 3);
}

this will produce:

$array[0] = ' do i remove the first 3 characters from a variable?';
$array[1] = 'n do i remove the first 3 characters from a variable?';
$array[2] = ' do i remove the first 3 characters from a variable?';




Cheers,


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Chris Lambert - WhiteCrown Networks [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 07, 2001 6:18 PM
To: Doron
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] how do i remove the first 3 characters from a
variable?


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 - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: Doron [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
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 [EMAIL PROTECTED] 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)
|   [EMAIL PROTECTED]
|   www.phpbeginner.com
| 
| 
| 
|  -Original Message-
|  From: Doron [mailto:[EMAIL PROTECTED]]
|  Sent: Saturday, July 07, 2001 7:06 PM
|  To: [EMAIL PROTECTED]
|  Subject: Re: [PHP] how do i remove the first 3 characters from a
|  variable?
| 
| 
|  does it work on arrays too??
| 
| 
|  Maxim Maletsky [EMAIL PROTECTED] 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)
|[EMAIL PROTECTED]
|www.phpbeginner.com
|  
|  
|  
|  
|   -Original Message-
|   From: Doron [mailto:[EMAIL PROTECTED]]
|   Sent: Saturday, July 07, 2001 5:37 PM
|   To: [EMAIL PROTECTED]
|   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: [EMAIL PROTECTED]
|   For additional commands, e-mail: [EMAIL PROTECTED]
|   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
| 
| 
| 
|  --
|  PHP General Mailing List (http://www.php.net/)
|  To unsubscribe, e-mail: [EMAIL PROTECTED]
|  For additional commands, e-mail: [EMAIL PROTECTED]
|  To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]