Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

get values from text file php

$lines_array = file("file.txt");
$search_string = "bing";

foreach($lines_array as $line) {
    if(strpos($line, $search_string) !== false) {
        list(, $new_str) = explode(":", $line);
        // If you don't want the space before the word bong, uncomment the following line.
        //$new_str = trim($new_str);
    }
}

echo $new_str;

?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #values #text #file #php
ADD COMMENT
Topic
Name
4+4 =