views:

8

answers:

1

I'm working on my own little back end framework for future clients and I'm making a folder named "Forms" to store all of my forms for CMS interaction. Inside the forms folder I'd like to store .php files similar to wordpress style plugins that I can title in the comments code like wp does... ie

/*
Plugin Name: Name Of The Plugin
Description: A brief description of the Plugin.
Version: The Plugin's Version Number, e.g.: 1.0
Author: Name Of The Plugin Author
Author URI: http://URI_Of_The_Plugin_Author
*/

I'm wondering how WP reads that data as it is commented out... do they use file_get_contents('plugin.php'); and parse it as well as include the plugin? Is there a php function to actually read comments?

Thoughts?

+1  A: 
  1. Read the file by FTP or file_Get_contents()`
  2. explode each line by : and get result in array
  3. array[0] makes the key and array[1] makes the value.
shamittomar