|
Posted by Vin on 10/02/28 11:07
"Vin" <vin@vjg.cc> wrote in message
news:20050203211056.75336.qmail@lists.php.net...
> "Marek Kilimajer" <lists@kilimajer.net> wrote in message
> news:420261B7.4030305@kilimajer.net...
> > Vin wrote:
> > > I need to create a search that will search partial files names of
images
> and
> > > display the images. Basically, I have a folder on the internet that
has
> > > security camera images dumped into it with a file name like this:
> > >
> > > MDcameraname20050109104846001N38B.jpg
> > > MDcameranameYYYYMMDDHHMMSS001N38B
> > >
> > > So what I would like to create is a search that will allow a user to
> input
> > > the year, month, day, and hour, and have the website display the
images
> from
> > > that hour. Could someone help me with this?
> > >
> > > Thanks in advance,
> > > Vinny
> > >
> >
> > http://sk2.php.net/manual/en/function.glob.php
>
>
> thanks, that is perfect. Now I have a follow up question if you don't
mind.
> How can I take $filename and break it apart to display the time/date the
> picture was taken in a nice readable format?
>
> here is my code:
>
> <?php
> $x = 0;
> $count = 0;
> $matches = glob("*$y$m$d$h*.JPG");
> if ( is_array ( $matches ) )
> {
> foreach ( $matches as $filename)
> {
> if ($x < 4)
> {
> echo "<td>";
> echo "<a href=javascript:pop('";
> echo $filename;
> echo "');>";
> echo "<img src='";
> echo $filename;
> echo "' border=0 width=240 height=180></a>";
> $count = $count+1;
> echo "<br>";
> echo $filename;
> echo "</td>";
> $x = $x + 1;
> } else {
> echo "</tr><tr>";
> $x = 0;
> }
> }
> }
>
> echo "<br><br>";
> echo $count . " images found";
> ?>
Here is an example of what I'm talking about:
Filename looks like this: MDcameraname20050108124537001A.JPG
I would like the output to look like this: 01/08/2005 12:45:37
Navigation:
[Reply to this message]
|