Re: deleting characters from strings
| From: | David Otton | Date: | Sun, 02 Nov 2003 05:30:07 +0000 |
| Subject: | Re: deleting characters from strings | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-168320@lists.php.net to get a copy of this message | ||
On Sat, 1 Nov 2003 11:25:09 -0600, you wrote:
>I feel really stupid posting this but I can't seem to find the correct
>syntax in the language guide. I have a string which has been progressively
>built during a FOREACH loop through an array (a SELECT statement in which
>the WHERE part is built with ORs from the array of entries). The final
>query winds up with an extra "OR" at the end. I need to simply delete
>characters (STRLEN($string) - 3) through STRLEN($string). What's the proper
>syntax?
Slightly more sensible approach:
<?
$a = array ('1', '2', '3', '4', '5');
$a = implode (' OR ', $a);
echo ($a);
?>