Search
 
SCRIPT & CODE EXAMPLE
 

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;

?>
Comment

PREVIOUS NEXT
Code Example
Php :: how send user to 404 page if not exist page in laravel 
Php :: use latest with first in laravel eloquent 
Php :: foreach stdclass object php 
Php :: php mkdir with 777 permission 
Php :: php random integer 
Php :: password_hash 
Php :: select max id laravel 
Php :: faker laravel 
Php :: laravel foreign key constraint 
Php :: laravel exists eloquent 
Php :: display all errors in blade laravel 
Php :: Larvel Print last query 
Php :: how to check using what guard in laravel 8 
Php :: drupal 7 hook_form_alter 
Php :: laravel validation exact string length 
Php :: php curl_exec get response json 
Php :: php convert string to int in array 
Php :: use model from variable laravel 
Php :: difference entre deux date php 
Php :: download laravel 8 zip 
Php :: laravel/ui for laravel 7 
Php :: use js in php 
Php :: php link to page 
Php :: php array remove key value pair 
Php :: laravel csrf token off 
Php :: php remove and  
Php :: catch any exception php 
Php :: mysqli_real_connect(): (HY000/2002): No such file or directory 
Php :: php json_encode utf8 
Php :: live update mysql data in php 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =