note 14705 added to function.substr.php

From: Date: Fri, 10 Aug 2001 18:46:36 +0000
Subject: note 14705 added to function.substr.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-16556@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 http://www.php.net/manual/en/function.substr.php

« previous php.notes (#16556) next »