Jump to content

Alex

Staff Alumni
  • Posts

    2,467
  • Joined

  • Last visited

Everything posted by Alex

  1. It's not really a =& operator. It's a normal assignment operator (=) and a reference operator (&). I find it's confusing, and somewhat misleading, to write it like that, and I prefer to have it written this way: $var = &$somethingelse; In the code you posted, that usage was seen commonly in PHP 4 to circumvent issues caused by flaws in the poor OOP support. It is no longer necessary because as of PHP 5 all objects are, by default, passed by reference.
  2. When cookies are actually physically deleted from the computer depends on the user-agent.
  3. In that usage they're two different things. || won't work in that context.
  4. Nope, you can't do that. Semi-related: You can do type-hinting in PHP 5.1+ in object methods: http://php.net/manual/en/language.oop5.typehinting.php edit: You could also check out the experimental SPL Types extension: http://pl.php.net/manual/en/book.spl-types.php
  5. You can't access files on a user's computer through PHP.
  6. You should always provide an alternative for users who might not have JavaScript support, even though there are very few these days.
  7. How do you know it's not receiving it? Have you tried to echo it out? If the issue is with the flash side we can't help without seeing any code.
  8. You need parenthesis around the condition. if (is_null($this->contents)) {
  9. http://www.google.com/search?q=free+php+auction+script
  10. echo number_format(7.5, 2); // 7.50 number_format
  11. There's a built-in function for this: array_chunk. print_r(array_chunk($arr1, );
  12. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=311010.0
  13. Then you're probably using single quotes instead of what you posted. Why not?
  14. Here's my take: function replace_skip($str, $find, $replace, $skip = 1) { $cpos = 0; for($i = 0, $len = strlen($find);$i < $skip;++$i) { if(($pos = strpos(substr($str, $cpos), $find)) !== false) { $cpos += $pos + $len; } } return substr($str, 0, $cpos) . str_replace($find, $replace, substr($str, $cpos)); } $str = 'test gfjgfjg test fdhsghg test test test'; echo replace_skip($str, 'test', 'xxxx');
  15. They allow you to ensure that a class contains certain methods. It's especially useful when you're releasing code to the public and they might be editing it. You can create an interface to ensure that a certain class contains certain methods, otherwise throw an error.
  16. Eh, it's not as bad as you think. For one, you have to remember that the court TV shows are there for entertainment. While the cases are real, they deliberately pick a lot of the crazy/dumb ones. Also remember that just because you have the right to sue, it doesn't mean you'll be successful. Judges toss out cases all the time. Small claims cases, which is what is shown on TV, is the cesspool of our legal systems. There's no real need for representation, and there's no screening process before they get to a judge. Because of that, it's usually a whole bunch of nonsense. Don't forget the fact that they're paid for their appearance, and because it's small claims court in most cases they really don't care if they win or those; they're getting paid regardless, so they're just there to put on a show.
  17. Honestly, I was expecting a lot more. Everything was very convincing in pushing that it would be a huge improvement, and sure it is a large improvement in many ways, but I couldn't even use the browser for more than a minute without running into bugs.
  18. This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=310676.0
  19. This topic has been moved to PHP Math Help. http://www.phpfreaks.com/forums/index.php?topic=310665.0
  20. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=310658.0
  21. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=310433.0
  22. You can use this: window.location.hash To get the hash, then from that you can create an associative array.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.