Answer the question
In order to leave comments, you need to log in
Is it possible to work with a file using the preg_match_all function? if so, how?
I am making a parser. The site code is downloaded to a file to work with regular expressions, but I don't know how to work with the file through the preg_match_all function. I tried to insert the file itself, but it says that you need to insert a string, not a file.
Answer the question
In order to leave comments, you need to log in
<?php
$file_content = file_get_contents($file_path);
preg_match_all($pattern, $file_content);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question