Got a quick question for you this time.
From the below preg_match_all() will always return a value of "Array" regardless what I try. To put this into plain code terms, $content will always = "Array".
I have tested whether it's getting the right input and it is. There are definetly [test123] and [/test123] custom tags in the php file it's reading into $buffer which later gets passed into preg_match_all() as $current_line. It should spit out whatever it between these tags.
The bug has got to be in the preg_match_all() right? Thanks in advance.
Here's the code:
function get_all_content_between($string, $start, $end)
preg_match_all( '/$start(.*)$end/s', $string, $match );
$rss_source_file = fopen("$rss_from_file", "r") or die("can't open file [SOURCE]");
$rss_write_file = fopen("$rss_to_file", "a") or die("can't open file [DESTINATION]");
while (!feof ($rss_source_file))
$buffer = fgets($rss_source_file);
$lines = $buffer;
$array_count = count($lines);
$matchtag_start = "[test123]";
$matchtag_end = "[/test123]";
for ($i = 0; $i < $array_count; $i++)
$current_line = $lines[$i];
$content = get_all_content_between($current_line, '\\(\\$matchtag_start\\(', "\\)\\$matchtag_end\\)");
fwrite($rss_write_file, $content ."\\r\