RE: [PHP] RTRIM() - Won't accept 2nd Param

2002-07-27 Thread Mark Charette

From the man page:

Note: The second parameter was added in PHP 4.1.0 

-Original Message-
From: Monty [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 27, 2002 7:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP] RTRIM() - Won't accept 2nd Param


When I issue this command to remove any commas at end of string:

$query = rtrim($query, ,);

PHP give me an error saying Wrong parameter count for rtrim(). How can
this be? The online manual shows rtrim can accept two parameters. Shouldn't
this work? I have PHP 4.0.6 installed on the server.


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




RE: [PHP] RTRIM() - Won't accept 2nd Param

2002-07-27 Thread David Freeman

  When I issue this command to remove any commas at end of string:
  
  $query = rtrim($query, ,);
  
  PHP give me an error saying Wrong parameter count for 
  rtrim(). How can
  this be? The online manual shows rtrim can accept two 
  parameters. Shouldn't
  this work? I have PHP 4.0.6 installed on the server.

From what I can see, the second parameter (that you are trying to use)
wasn't introduced until v4.1.0 - that is, you can't use it with your
version of php.

You may find that if you can't upgrade your php you'll need to do
something with substr() and str_pos().

CYA, Dave




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