Ask a Question related to PHP Development, Design and Development.
-
Mike Ford #1
RE: [PHP] seeing strange things?
> -----Original Message-----
This is because count() returns the number of elements in the array, but because the indexes start at zero the highest offset is count($parts)-1 -- so when you try to access element count($parts), PHP throws a wobbly.> From: Micah Montoy [mailto:montmica@isu.edu]
> Sent: 09 July 2003 01:37
>
> A couple more things and I'll stop bugging everyone. I'm
> trying to get the
> file name of the string. If it includes the extension that's
> fine as well.
> I thought the code below would do this but its not.
>
> $filevalue = str_replace("\\\\", "/", $filevalue);
>
> //get specific file name
> $parts = explode("/",$filevalue);
> $file_name = $parts[count($parts)]; //line 42
>
> Its giving me error:
> Notice: Undefined offset: 6 in
> c:\inetpub\wwwroot\webpage10\example\u_images\act_ load_imgs.ph
> p on line 42
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: [email]m.ford@lmu.ac.uk[/email]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
Mike Ford Guest
-
strange things happening..
Contribute acting strange.. Using Contribute for 3 years now, and on some pages it randomly decides to stop letting people ?paste? in the... -
Strange Things
I had functioning, working applications under Flash Comm?s ?application? directory previously before I reformatted my computer. However now only a... -
IIS Security strange things
I have intranet application based on ASP.NET on Win2000AS (Framework 1.1). Website uses an Integrated Windows Authentication as Authentication... -
Strange things in Opera...
Hi All... I have a small and rather odd problem that I've not encountered before, and from what I can see it could be browser specific. We... -
seeing strange things?
A couple more things and I'll stop bugging everyone. I'm trying to get the file name of the string. If it includes the extension that's fine as...



Reply With Quote

