• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to delete relevant files?

#1
[eluser]solid9[/eluser]
Hi guys

Let say I have a file called android.jpg

Now it has relevant file names for example,

android1.jpg
android2.jpg
android3.jpg
android4.jpg
android5.jpg
iOS1.jpg
iOS2.jpg
iOS3.jpg
iOS4.jpg

But I wanted to delete this android* relevant files only.

How to delete them?

Thanks in advanced.




#2
[eluser]Cristian Gilè[/eluser]
Code:
$files = glob('android*.jpg');
array_map('unlink',$files);

#3
[eluser]solid9[/eluser]
hi cristian

Is glob(); a built-in in php? or CodeIgniter?

#4
[eluser]solid9[/eluser]
ah okay it's PHP.

Thanks dude.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.