note 14792 added to function.split.php

From: Date: Wed, 15 Aug 2001 04:07:56 +0000
Subject: note 14792 added to function.split.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-16740@lists.php.net to get a copy of this message
Perhaps someone can tell me about this one I ran across. I was trying to split a filename by the periods that it contained so that I could get the extension and print a nifty image that corresponded. I used this code: $row = split('.',$filename); $extension = strtolower($row[sizeof($row)-1]); $docsize = getdocsize($dbh,$studentdocids[$i]); Well, $row ended up being empty until I changed the first line to be the following: $row = split('\.',$filename); I haven't seen this mentioned anywhere, so I figured that I would mention when in doubt, use the backslash. http://www.php.net/manual/en/function.split.php

« previous php.notes (#16740) next »