Php newbie here
Can someone please tell me what is wrong with the syntax below. I have a maximum of 4 files - $ created_page1, $ created_page2, each of which has a corresponding title, etc. And I would like to process them in a loop. However, PHP throws shaky every time I try to concatenate a string and a loop number - in particular, $ created_page. $ Num_pages does not send the function $ created_page1 or $ created_page2 to the function, but simply converts the string and number to an integer. I am very sure, but I would be very grateful for any help or a more pleasant solution that I can easily understand. Thanks in advance!
$addit_pages == 4;
for ($num_pages=1;$num_pages<=$addit_pages ;$num_pages++) {
replaceFileContent ($dir,$created_page.$num_pages,"*page_title*",$page_title.$num_pages);
//replaceFileContent ($dir,$created_page2,"*page_title*",$page_title2);
//replaceFileContent ($dir,$created_page1,"*page_title*",$page_title3);
//replaceFileContent ($dir,$created_page3,"*page_title*",$page_title4);
}
source
share