Solved

Make directory with copy

Posted on 2009-05-14
2
195 Views
Last Modified: 2012-05-07
How can I create a directory if it does not already exsist when using copy() ?
copy($filename,'my/directory/that/needs/to/be/created/'.$filename);

Open in new window

0
Comment
Question by:hankknight
  • 2
2 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 24388018
Look at mkdir()
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 24388044
But after reading the fine man page, it looks like the second parameter is a path, and will be created for you.  PHP 4 or PHP 5?

http://us.php.net/manual/en/function.mkdir.php
http://us.php.net/manual/en/function.copy.php
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now