Jump to content


Photo

Most Confusing Function/Snippet


  • Please log in to reply
1 reply to this topic

#1 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 23 February 2006 - 09:05 PM

for those of you who actually read the manual (which should be everyone!!!), i'm curious to what the least helpful, or even the most confusing example code you've found is. i'll have to say that the most confusing to me initially was the code example for the eval() function:

<?php
$string = 'cup';
$name = 'coffee';
$str = 'This is a $string with my $name in it.';
echo $str. "\n";
eval("\$str = \"$str\";");
echo $str. "\n";
?> 
The above example will output:
This is a $string with my $name in it.
This is a cup with my coffee in it.


not only was that extremely confusing, but after reading the description of the function and playing around with it, it only got worse... thankfully, i was able to come to an understanding of it, but it was quite difficult.

so, what's your story?
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#2 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 23 February 2006 - 10:33 PM

Well, the LEAST useful thing I have found is PREG_ANYTHING! I can't ever get it to work!
I Always end up doing something with String_Replace()
LOL

of course, that may be a VERY BIASED answer!

LOL




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users