CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Thread: Array Problem

Threaded View

  1. #1
    Join Date
    Jun 2005
    Posts
    115

    Array Problem

    alright im having bit of trouble here...

    i have 2 files english.lang and grab-template.php

    I want to load english.lang and create an array out of it in get-template.php so I can then do a replace.

    english.lang
    Code:
    'UPLOAD' => 'Upload Files',
    'MANAGE' => 'Manage Files',
    'SHARE' => 'Share Files'
    grab-template.php
    Code:
    	$words_arr = array(file_get_contents('language/english.lang'));
    	print_r($words_arr);
    whats happening is that it grabs the information successfully but then it thinks the file_get_contents is one entire string which it is making and then sends it to the array so there is one thing in the array

    $words_arr[0]

    and when you echo that it displays

    Code:
    Array ( [0] => 'UPLOAD' => 'Upload Files', 'MANAGE' => 'Manage Files', 'SHARE' => 'Share Files' )
    when I would actually want
    Code:
    Array ( [UPLOAD] => Upload Files [MANAGE] => MANAGE [SHARE] => Share Files)
    Last edited by Forsakenblade; March 26th, 2007 at 09:18 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured