This code snippet demonstrates how to read a resource file and convert them to php variables:

< ?_php
$arr = file("resource.txt");
foreach ($arr as $key => $value) {
$arr = split(”t”,$value); // tab delimeted. You can use any.
$$arr[0] = $arr[1];
}

//Example - “name” is a word in text tile with ‘tab’ delimeted sample text.
echo $name;
?>

Sample resource.txt file: (tab delimeted)

txt_title hello world
txt_message this is a message
name Contact

VN:F [1.1.6_502]
Rating: 0.0/5 (0 votes cast)
Share:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • LinkedIn
  • Live
  • MySpace
  • StumbleUpon
  • Technorati

Related posts:

  1. Dynamic loading of content in a Dropdown box - without Ajax - Part II
  2. A simple ISAPI extension with C#
  3. Reverse text as you type
  4. Microsoft Access Database (MDB) from PHP
  5. Get value from resource in .net