I need to create a search that will search partial files names of images and display the images. Ba

I need to create a search that will search partial files names of images and display the images. Ba

am 03.02.2005 17:55:09 von vin

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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: I need to create a search that will search partial files

am 03.02.2005 18:23:49 von Richard Lynch

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?

Take the sample code from http://php.net/readdir and then the sample code
from http://php.net/preg_match and you're pretty much done...

--
Like Music?
http://l-i-e.com/artists.htm

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: I need to create a search that will search partial files

am 03.02.2005 18:39:03 von Marek Kilimajer

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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: I need to create a search that will search partial filesnames of images and display the images.

am 03.02.2005 22:10:48 von vin

"Marek Kilimajer" 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:

$x = 0;
$count = 0;
$matches = glob("*$y$m$d$h*.JPG");
if ( is_array ( $matches ) )
{
foreach ( $matches as $filename)
{
if ($x < 4)
{
echo "";
echo " echo $filename;
echo "');>";
echo "
";
$count = $count+1;
echo "
";
echo $filename;
echo "";
$x = $x + 1;
} else {
echo "";
$x = 0;
}
}
}

echo "

";
echo $count . " images found";
?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: I need to create a search that will search partial filesnames of images and display the images.

am 03.02.2005 22:58:48 von vin

"Vin" wrote in message
news:20050203211056.75336.qmail@lists.php.net...
> "Marek Kilimajer" 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:
>
> > $x = 0;
> $count = 0;
> $matches = glob("*$y$m$d$h*.JPG");
> if ( is_array ( $matches ) )
> {
> foreach ( $matches as $filename)
> {
> if ($x < 4)
> {
> echo "";
> echo " > echo $filename;
> echo "');>";
> echo "
";
> $count = $count+1;
> echo "
";
> echo $filename;
> echo "";
> $x = $x + 1;
> } else {
> echo "";
> $x = 0;
> }
> }
> }
>
> echo "

";
> 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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: I need to create a search that will search partial filesnames

am 03.02.2005 23:15:13 von Marek Kilimajer

Vin wrote:
>
> 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
>

preg_match('/MDcameraname([0-9]{4})([0-9]{2})([0-9]{2})([0-9 ]{2})([0-9]{2})/',
$filename, $m);

$m[1] - year
$m[2] - month
..... etc.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: I need to create a search that will search partial filesnamesof images and display the images.

am 03.02.2005 23:21:08 von vin

"Marek Kilimajer" wrote in message
news:4202A271.6010004@kilimajer.net...
> Vin wrote:
> >
> > 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
> >
>
>
preg_match('/MDcameraname([0-9]{4})([0-9]{2})([0-9]{2})([0-9 ]{2})([0-9]{2})/
',
> $filename, $m);
>
> $m[1] - year
> $m[2] - month
> .... etc.

Thank you all for your help.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php