Answer the question
In order to leave comments, you need to log in
How to find and substitute the desired value in a variable from txt?
Next to c php is a txt file with many lines
how to find the right one and substitute it into a variable in php?
Answer the question
In order to leave comments, you need to log in
<?php
$file = file('list.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach ($file as $line) {
if (false !== strpos($line, 'SashaGrey')) {
$str = $line;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question