note 14705 deleted from function.substr.php by philip
| From: | philip@php.net | Date: | Fri, 10 Aug 2001 20:04:54 +0000 |
| Subject: | note 14705 deleted from function.substr.php by philip | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-16559@lists.php.net to get a copy of this message | ||
One of the ways I used substr was when I made a query for my database I had to run a loop to pull
all variables that I needed from the database. Unfortunitly I would end up with a " or "
left over so what I did was:
$length = strlen ($query);
$length = $length - __ ; // How ever many characters you want to get rid off
$query = substr ($query, 0, $length);
I'm sure there are more elegant ways of doing this (please show me if there are), but it worked
for me.
Peace and Happy Coding
-DD2