Jump to content

just a little script I need.


Birdman203

Recommended Posts

I need a script and do not know how to make it, but it:
1. Searches through a folder and looks for files starting with [b]admin.[/b]
2. After that it reads the file and looks for $title and puts it in an array.

The array should look like so:
[code]
array (
  1 (
    file -> "name of file",
    title -> "$title from the file"
  )
  2 (
    file -> "name of file",
    title -> "$title from the file"
  )
)
[/code]

I hope you understand this
Link to comment
Share on other sites

[!--quoteo(post=388208:date=Jun 26 2006, 04:42 PM:name=Birdman203)--][div class=\'quotetop\']QUOTE(Birdman203 @ Jun 26 2006, 04:42 PM) [snapback]388208[/snapback][/div][div class=\'quotemain\'][!--quotec--]
is anyone looking into this?
[/quote]
Aren't you?

The glob() function - with selector - will give you the .php file names. Throw away all those that don't start with admin and put the rest in an array. That'll get you started.
Link to comment
Share on other sites

[code]
<?php
$d = 0;
foreach (glob("admin_*.php") as $filename) {
    $arr = array(
        'file' => $filename,
        'title' => "title"
    );
    $array[$d++] = $arr;
}
?>
[/code]

Tested it and it works. Now how do I do the title.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.