Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,151,312 members, 7,811,926 topics. Date: Sunday, 28 April 2024 at 11:52 PM

Php Quiz: Evalute Php Script - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Php Quiz: Evalute Php Script (1329 Views)

Were To Get A Php Script That Will Be Like Nairaland / Most Confusing And Simple Maths Quiz / Php/mysql. Does Every Php Script Need A Database? (2) (3) (4)

(1) (Reply)

Php Quiz: Evalute Php Script by Nobody: 10:56pm On Aug 25, 2011
Let us take a look at the code below string below:

<?php
$str='
This is nairaland and today is <?php echo date("m/d/y"wink;?>
I will like to visit facebook ahora. Meanwhile the current time stamp is <?php echo time();?>
';
?>

Now, let us assume you have string containing allow those jargons. What is the fastest way
to parse it to get the pure html output.
Re: Php Quiz: Evalute Php Script by sisqology(m): 5:43am On Aug 26, 2011
*dhtml:

Let us take a look at the code below string below:

Quote
<?php
$str='
This is nairaland and today is <?php echo date("m/d/y"wink;?>
I will like to visit facebook ahora. Meanwhile the current time stamp is <?php echo time();?>
';
?>

Now, let us assume you have string containing allow those jargons. What is the fastest way
to parse it to get the pure html output.









<?php
$str='
This is nairaland and today is '
$msg=
'I will like to visit facebook ahora. Meanwhile the current time stamp is ';
?>
<?php echo $str;
echo date('J F Y');
echo $msg;
echo date('H:i:s');
?>
Re: Php Quiz: Evalute Php Script by Nobody: 5:47am On Aug 26, 2011
Nope, the solution is going to look like this:

<?php
eval("$str"wink;

//You might need to use ob_start and ob_get_contents
echo $output;
?>
I am just hinting that you will use the eval command.

Of course, so many PHP script tags might be used. Even if them be 1000, the solution should work.

(1) (Reply)

Afrisoft Interactive To Empower 1,000 / Best And Worst Government Websites / Some Web Developers Are Just Worthless

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.