Run PHP Code Inserted Into WordPress Posts and Pages
Run PHP code inserted into WordPress posts and pages. First download, Install & activate given bellow plugin called Insert PHP
[button color=”” size=”” type=”” target=”” link=”https://downloads.wordpress.org/plugin/insert-php.zip”]DOWNLOAD[/button]
You can use following PHP code between special tags:
[insert_php] instead of "<?php" and [/insert_php] instead of "?>"
The PHP code runs as the page is sent to the browser. Output of the PHP code is published directly onto the post or page where the PHP code between the special tags is located.
The code between the tags must be complete in and of itself. References to variables or code blocks outside the area between the tags will fail. See the “more information” URL for an explanation of this.
Examples of use:
- Publish local time (users’ computer clock settings being unreliable).
- Insert output of a PHP script, or just to run a script whether or not it generates output.
<?php print "PHP is Fun\n"; print "Hello world!\n"; print "I'm about to learn PHP!"; ?>
this is a preview of above php script
print “PHP is Fun!\n”;
print “Hello world!\n”;
print “I’m about to learn PHP!”;