I have problem with using get_file_content after preg_match and str_replace.
When I read from base, text look like:
Some text with shortcodes: [formularz {"agree":"1,1,1","option":"firstname,lastname,phone,email,company","leadfrom":"Allegro"}] [formularz {"agree":"0,1,0","option":"firstname,lastname,phone","leadfrom":"Allegro"}]
Then I looking my regular '[]':
preg_match_all('/\[formularz (.*)\]/',$campaign['content'],$matches);
Then I replace some chars and words:
echo str_replace($matches[0],str_replace([':','","','"','{','}'],['=','&','','file_get_contents("http:// mydomain.com/form.php?id_added_to_lead='.$id_added_to_lead.'&','")'],$matches[1]),str_replace(array(" ", "", " "), "
",stripslashes($campaign['content']))) ;
And finally I have:
Some text with shortcodes: file_get_contents("http:// mydomain.com/form.php?id_added_to_lead=100&agree=1,1,1&option=firstname,lastname,phone,email,company&leadfrom=Allegro") file_get_contents("http:// mydomain.com/form.php?id_added_to_lead=100&agree=0,1,0&option=firstname,lastname,phone&leadfrom=Allegro")
What should I do, If I want to execute file_get_content in content?