note 31439 added to function.substr

From: Date: Tue, 22 Apr 2003 03:44:45 +0000
Subject: note 31439 added to function.substr
Groups: php.notes 
Request: Send a blank email to php-notes+get-46920@lists.php.net to get a copy of this message
i'm trying to get the first and last word of a field... so for the first word i did, $sql = "select SUBSTRING_INDEX(field, ' ', n) FROM tablename" ; $first = query($sql); and for the last one $sql = "select SUBSTRING_INDEX(field, ' ', -n) FROM tablename"; $last = query($sql); so far so good... but when i try to print the values of $first and $last like print($first[0]); all i get is "Array" :p any idea? -- http://www.php.net/manual/en/function.substr.php http://master.php.net/manage/user-notes.php?action=edit+31439 http://master.php.net/manage/user-notes.php?action=delete+31439 http://master.php.net/manage/user-notes.php?action=reject+31439

« previous php.notes (#46920) next »