Thread: Here ya go Eddiy

Results 1 to 2 of 2
  1. #1 Here ya go Eddiy 
    Registered Member
    Join Date
    Jan 2013
    Posts
    138
    Thanks given
    39
    Thanks received
    9
    Rep Power
    0
    Quote Originally Posted by Eddies View Post
    From text file I want Create an associative array(with a key and data) I need the first three characters of each line read as the key and the rest of the line as the value or data.

    https://ibb.co/mRZJcK - I want an output like this
    https://ibb.co/dnaDBe - This the text file used
    https://ibb.co/cRMnNU - instrutions
    Here ya go Girl!

    I expect you transfer the 50 mill tonight to my bank account.
    Code:
    <?php
    $handle = fopen("input.txt", "r");
    $result_array = array();
    //generate Assoc array
    if ($handle) {
       while(!feof($handle)) {
            $line = fgets($handle);
    		$key = substr($line, 0, 3);
    		$value = substr($line, 3, strLen($line));
    		$result_array[$key] = $value;
    
        }
    
        fclose($handle);
    } else {
        echo "error opening the file";
    } 
    ?>
    <!DOCTYPE>
    <html>
    	<head>
    		<meta charset="utf-8">
    		<title>RSPS - HomeWork comunity</title>
    	</head>
    	<body>
    		
    		<table>
      <tr>
        <td>KEY</td>
        <td>DATA</td>
      </tr>
      <?php foreach($result_array as $key => $value) :?>
      <tr>
        <td><?php echo $key; ?></td>
        <td><?php echo $value; ?></td>
      </tr>
      <?php endforeach; ?>
    
    </table>
    	</body>
    </html>

    WHY AM I BLOCK FOR POSTING COMMENTS!
    I CANNOT POST THIS AS REPLY, thus thee should make a thread!
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Mar 2017
    Posts
    39
    Thanks given
    2
    Thanks received
    0
    Rep Power
    11
    lmaooooooooooo Thanks bro kind late but thanks man!

    I will pay you when I need a tutor
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. If anyone wants a Deadly PKers account (Donator) here 'ya go
    By Ambient in forum RuneScape Underground
    Replies: 3
    Last Post: 08-31-2012, 02:03 PM
  2. Fuck Sinzscape HERE YOU GO
    By Dyllan in forum Downloads
    Replies: 8
    Last Post: 06-22-2010, 05:43 PM
  3. here we go!!!
    By oxym in forum Projects
    Replies: 11
    Last Post: 09-26-2009, 03:02 AM
  4. Here ya go KascadeX
    By Numbers in forum Showcase
    Replies: 0
    Last Post: 09-06-2007, 02:15 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •