PHP: php and .html file separation
问题 I'm currently working on separating HTML & PHP code here's my code which is currently working for me. code.php <?php $data['#text#'] = 'A'; $html = file_get_contents('test.html'); echo $html = str_replace(array_keys($data),array_values($data),$html); ?> test.html <html> <head> <title>TEST HTML</title> </head> <body> <h1>#text#</h1> </body> </html> OUTPUT: A it search and change the #text# value to array_value A it works for me. Now i'm working on a code to search "id" tags on html file. If it