Is there a way to delay a function so that it doesn't run for a day or two later? I'm somewhat familiar with sleep(), but I really don't think that's what I ought to use.

What I need is a text file to be processed over the weekend/holidays when there is no one in the office, and I thought if I triggered it on Friday I could just set it up to wait a day or so and then run.

I can set an FTP client to upload at a specific time, so I could go that route. If I do, can I just make a script to look into the folder the file is going to and automatically process it?

I'm not sure how I want to start this, so if anyone wants to maybe point me in the right direction I would be grateful.

Recommended Answers

All 3 Replies

Cron is what you're looking for. Give it a google and have fun.

I did come across that a couple times when I was looking around earlier. That's not actually a php function though is it? I'll look into it. Thanks a lot.

I did come across that a couple times when I was looking around earlier. That's not actually a php function though is it? I'll look into it. Thanks a lot.

No, it's a program separate of PHP altogether whose purpose is to schedule tasks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.