Re: [PHP-DB] Need to delete charcters from a string

2002-02-08 Thread Renaldo De Silva

This dosen't quite do what  i need, this atually just displays the last 3 
characters of the string removing everything else, I wanted to do the 
opposite, but thanks anyways.

Joe Van Meer wrote:

 Why couldn't you use something like this:
 
 $mystr = substr($mystr, -3);
 
 Joe
 
 
 Jeroen Timmers [EMAIL PROTECTED] wrote in message
 003001c1b026$97373cb0$7f6440d4@jeroen">news:003001c1b026$97373cb0$7f6440d4@jeroen...
 you can take the function substr from php in combination with strlen
 (lenght
 of a string)

 example

 $string = 1234567890;
 $rest = substr($string, 0, strlen($string)-3); // returns 1234567

 Success Jeroen Timmers


 - Original Message -
 From: Renaldo De Silva [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Thursday, February 07, 2002 8:56 PM
 Subject: [PHP-DB] Need to delete charcters from a string


  I need to delete the last 3 character of a string, what command can i
 use
 o
  do this.
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Need to delete charcters from a string (Works)

2002-02-08 Thread Rick Emery

$mystring = substr($mystring,0,-3);

 - Original Message -
 From: Renaldo De Silva [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Thursday, February 07, 2002 8:56 PM
 Subject: [PHP-DB] Need to delete charcters from a string
 
 
 I need to delete the last 3 character of a string, what command can i use
 o
 do this.

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Need to delete charcters from a string

2002-02-08 Thread Rick Emery

You were close:

$mystr = substr($mystr, 0, -3);

-Original Message-
From: Renaldo De Silva [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 7:36 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Need to delete charcters from a string


This dosen't quite do what  i need, this atually just displays the last 3 
characters of the string removing everything else, I wanted to do the 
opposite, but thanks anyways.

Joe Van Meer wrote:

 Why couldn't you use something like this:
 
 $mystr = substr($mystr, -3);
 
 Joe
 
 
 Jeroen Timmers [EMAIL PROTECTED] wrote in message
 003001c1b026$97373cb0$7f6440d4@jeroen">news:003001c1b026$97373cb0$7f6440d4@jeroen...
 you can take the function substr from php in combination with strlen
 (lenght
 of a string)

 example

 $string = 1234567890;
 $rest = substr($string, 0, strlen($string)-3); // returns 1234567

 Success Jeroen Timmers


 - Original Message -
 From: Renaldo De Silva [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Thursday, February 07, 2002 8:56 PM
 Subject: [PHP-DB] Need to delete charcters from a string


  I need to delete the last 3 character of a string, what command can i
 use
 o
  do this.
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Need to delete charcters from a string

2002-02-07 Thread Jeroen Timmers

you can take the function substr from php in combination with strlen (lenght
of a string)

example

$string = 1234567890;
$rest = substr($string, 0, strlen($string)-3); // returns 1234567

Success Jeroen Timmers


- Original Message -
From: Renaldo De Silva [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, February 07, 2002 8:56 PM
Subject: [PHP-DB] Need to delete charcters from a string


 I need to delete the last 3 character of a string, what command can i use
o
 do this.

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Need to delete charcters from a string

2002-02-07 Thread Rick Emery

$str = substr($str,0,-3);

-Original Message-
From: Renaldo De Silva [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 1:57 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] Need to delete charcters from a string


I need to delete the last 3 character of a string, what command can i use o 
do this.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Need to delete charcters from a string

2002-02-07 Thread Joe Van Meer

Why couldn't you use something like this:

$mystr = substr($mystr, -3);

Joe


Jeroen Timmers [EMAIL PROTECTED] wrote in message
003001c1b026$97373cb0$7f6440d4@jeroen">news:003001c1b026$97373cb0$7f6440d4@jeroen...
 you can take the function substr from php in combination with strlen
(lenght
 of a string)

 example

 $string = 1234567890;
 $rest = substr($string, 0, strlen($string)-3); // returns 1234567

 Success Jeroen Timmers


 - Original Message -
 From: Renaldo De Silva [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Thursday, February 07, 2002 8:56 PM
 Subject: [PHP-DB] Need to delete charcters from a string


  I need to delete the last 3 character of a string, what command can i
use
 o
  do this.
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php