Write a function to do whatever you want to each element, then use
array_walk().
---John Holmes...
> -Original Message-
> From: Hatem Ben [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, October 05, 2002 6:49 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Some data manipulation
>
> hey all
i was trying to do it with preg_replace, but this is much better
thanks a lot,
Hatem
- Original Message -
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Hatem Ben" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, October 06, 2002 3
So loop through and check the last char. Am I missing something that
makes this harder than the obvious:
foreach($arr as $key=>$val) {
$end = $val[strlen($val)-1];
switch($end) {
case '1': $arr[$key] = substr($val,0,-1); break;
case '2':
case '3': $arr[$key] = su