PHP - Get string based on file -


this question has answer here:

simply in php replace string other string such using particular function, str_replace (), etc

suppose have file.txt contains

text1 text2 text3 ... text n 

and have variable $text such as:

$text = "i want text1 , text2"; 

how strings (text1 , text2) based on available strings in file.txt?

i want have new variable ($new) contains strings of $text fits on string file.txt

i appreciate greatly.

thank you

use this:-

$lines = file('textfile.txt');  foreach ($lines $line_num => $line) {     something.... } 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -