Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. You probably need the plugin for the browser. It usually installed with the app.
  2. It's just a shortcut. It does exactly the same thing. It cannot check if it's less than something and greater than something else at the same time anyway. It's purely a convenience feature.
  3. There is nothing preventing you from implementing the PHP syntax and standard library yourself. It's exactly the same thing as gcc is not "in" your code if you write something in C. Only there exist multiple C compilers of course. There is a significant difference between being a derivative of something and just using it.
  4. That was supposed to have been sprintf(), but I see you solved it anyways
  5. Because you're matching (searching), not replacing...
  6. You can use sprint(). It's being converted to a float because it overflows the range of integers.
  7. Use Google to find a regular expression for URLs. Then do like: text.replace(/the regex here/, 'url');
  8. If you want positive integers without leading zeroes you can do this: preg_match('#^[1-9][0-9]*$#', $str); If you want to include 0 as well you can do: preg_match('#^(?:[1-9][0-9]*|0)$#', $str);
  9. That's fairly straightforward. It'll always match [a-zA-Z0-9+=/]+
  10. That's not entirely fool-proof. The rule is that you put the indefinite article 'an' before a vowel sound, not just before vowels. It's called "an hour", but "a horse" and it's called "an Xbox", but "a xylophone".
  11. You should fix your SMTP server.
  12. Databases are build to handle a lot of data. They handle handle more than you probably think they can. The indexes are the key here because that's what makes it unnecessary to search linearly through the entire table.
  13. Well, a simple way of doing it would be a table structure like this: pm_id recipient_id (references users table) sender_id (references users table) subject body sent_at (DATETIME) That should work find with indexes on recipient_id and sender_id.
  14. Use a for loop and use the counter for that.
  15. Ok so then just do eval($varval);. eval() simply takes a piece of PHP code and evaluates it ("executes it") in the current context.
  16. Try to echo instead of eval()'ing. In that way it'll be easier to see what the error is.
  17. What do you mean with override?
  18. Redirecting using the Refresh header is not a good idea for accessibility. It breaks the back button. You should rather just display a message on the new/next page instead.
  19. Take a look at http_build_query.
  20. There is also the DirectoryIterator or RecursiveDirectoryIterator for more advanced stuff.
  21. I would just store it in a file and check the file's last modification date. If it hasn't been modified within the last 24 hours, show the quote in there, otherwise update it. You can use filemtime to check the modification date.
  22. What you have is tabular data, so use a... table (won't fix that problem though)
  23. Some IDEs allow you to search and replace through multiple files. You could also just use PHP to traverse through the directory tree and modify the files like that.
  24. Ah sorry here you go: preg_match('#<body[^>]+bgcolor=[\'"]([\#a-z0-9]+)[\'"][^>]*>#i', $source, $matches); $color = $matches[1]; I forgot to escape the # inside the regex.
  25. In the case of MySQL, you would then want to use InnoDB because it has got row level locking. It only locks a row you are currently using and not the entire table like MyISAM does.
×
×
  • 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.