TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Tips & Tricks (http://www.talkphp.com/tips-tricks/)
-   -   Outputting data without print/echo (http://www.talkphp.com/tips-tricks/2386-outputting-data-without-print-echo.html)

Wildhoney 12-02-2008 10:23 PM

Lol :-) Who's a clever bug?

zxt3st 12-03-2008 03:02 AM

Quote:

Originally Posted by Wildhoney (Post 20141)
Lol :-) Who's a clever bug?

talkphp members lol :)

FractalizeR 12-18-2008 09:42 AM

Sorry for bumping an old post. There is a better quiz:
http://www.talkphp.com/tips-tricks/3...html#post20597

Dingdong 12-26-2008 09:24 AM

Here's my "effort":

<?php
if (1 == 0) {
die('See, no need for echo or print');
}
?>

FractalizeR 12-26-2008 10:47 AM

Why there is "if" at all then?

Dingdong 12-26-2008 11:18 AM

'cause it looked cooler...

Nah, you're right.

Rendair 03-22-2009 10:49 AM

GD FTW :P woo

PHP Code:

Prelude"Hello, World!"
"Hello, World!" 


JaoudeStudios 07-16-2009 06:33 AM

Quote:

Originally Posted by Salathe (Post 11800)
PHP Code:

Hello World


Very clever! ;-)

Salathe 07-16-2009 08:41 AM

Hehe thanks, I thought so too! Any chance of some more fun little threads like this being created? :-)

zxt3st 07-16-2009 09:55 AM

That is a cool idea..

DannyD 08-27-2010 02:39 PM

Quote:

Originally Posted by erect (Post 20139)
how about breaking out of php and just getting the html to output?

PHP Code:

?>text to this page<?

no echo's or print's involved

Or... no PHP tags so it gets interpreted as text and delivered to your screen this summer! 8-)

SaintIsaiah 11-18-2010 08:10 PM

How about vprintf? Using a preg_match single line if to determine the string value? And utilizing a class?

So do I win lol?

Heh, the object being called at the end is Talk->PHP($output);

PHP Code:

<?php
class Talk
{
   var 
$output '';

   function 
PHP($str)
   {
      
vprintf('%s'$str);
   }
}

$TalkPHP 'Totally Awesome!!!!';
$output = (preg_match('*Awesome*'$TalkPHP)) ? 'TalkPHP is Totally Awesome!' '';

$Talk = new Talk();
$Talk->PHP($output);
unset(
$Talk);
?>


ajayraj 12-28-2012 10:34 AM

You all missed print_r
 
You all missed print_r;

<?
echo "<pre>";
print_r('something');
echo "</pre>";
?>

vinothviv 03-06-2013 11:26 AM

Use print_r from array
 
<?php $test_array=("Hello World.");
print_r($test_array);
?>

<?php $test_array=("<b>Hello World.</b>");
print_r($test_array);
?>


All times are GMT. The time now is 07:15 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0