simply in php we could replace a string by other string such as using a particular function, str_replace (), etc
suppose I have a file.txt
contains
text1
text2
text3
...
text n
and i have a variable $text
such as:
$text = "I want to get text1 and text2";
How to get the strings (text1 and text2) based on the available strings in file.txt?
i want to have a new variable say ($new) which contains strings of $text that it fits on the string file.txt
i appreciate your help greatly.
thank you