Jump to content

salathe

Staff Alumni
  • Posts

    1,832
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by salathe

  1. Have a read of the variable scope section of the manual. If you still aren't sure what is happening, let us know; though that page should make everything clear.
  2. An alternative approach would be something like the following, which might be easier to understand at-a-glance. /^\d([ -]?\d)*$/D Also note that the literal space character was used (since \s matches more than just the space character) as was the D modifier (which prevents values with trailing newlines from being false positives).
  3. This is the PHP Coding Help forum, where we help you with your coding. We're not here to write code for you, nor come running when you PM random members asking for urgent help. We certainly won't help people who demand code without demonstrating a willingness to learn. Can you do that? P.S. Welcome to PHPFreaks.
  4. I use echo mostly because it does what it says in the manual, and is less typing (both in terms of number of characters and ability to mash the keyboard and get the right sequence of them) and I like shouting in caves.
  5. It's the advertising code, nothing we can do about it (other than taking away the ads). Thanks for the report though.
  6. We really need to stop labeling the packages as "FREE JELLY BEANS"... I suspect the mail men have been taking advantage!
  7. When asking to mark the thread as solved, take note of whether the person is new (possibly go look to see if they've marked any others as solved) then point them in the right direction. Asking them to click the "TOPIC SOLVED" button, which is below the posts, on the left of the screen, above the Quick Reply box, ain't too difficult now is it? Also, don't forget to tell them that they'll get jelly beans when they mark a thread as solved.
  8. We are here to help you to write your own code, not to give you finished code (there's a forum for that). Note that the PHP Coding Help forum has this description (see emphasis): Do you need help with some code you wrote? Ask here! We'll get you the answers! Also, there are lots and lots of threads on here about writing, or planning how to write, licensing software in PHP. This sounds like what you are wanting (your server verifies that the software is allowed to be run on wherever it is trying to be run).
  9. That is by far the most common issue that people run into when using readdir. Glad you got it sorted.
  10. That sounds like a good idea, preferably a snippet that is short but shows what is going on.
  11. Sounds like you had a great time, and have a very positive attitude towards learning your new role. Great! My first day at my current job mostly involved building things like my office chair and a pair of development machines.
  12. Gosh darn fugix, you had me worried there for a second! Then, like spiderwell, I remembered it happened here a while back (but less than a year ago). Happy Mother's Day to all mothers for whom it is Mother's Day today, and happy Sunday (or whatever day it is right now) to all the rest!
  13. That's not the case at all. www\.? means, match www optionally followed by a dot. To make the whole www\. sequence optional, you'd need to wrap it into a (usually non-capturing) group (like (?:www\.)?).
  14. \" should be " in that last line of code.
  15. Use strpos, if that function returns FALSE then the character is not within the string. $has_tilde = (strpos($string, '~') !== FALSE);
  16. SELECT oneID FROM table WHERE table.PersonID = 'game.PlayerA' Do you really have a table named table and a row with the PersonID column containing the literal characters game.PlayerA? Should game.PlayerA reference a column from a game database?
  17. It might make more sense to use an XPath query to ask for only the type="release" results. $releases = $xmlmusic->xpath('searchresults/result[@type="release"]'); foreach ($releases as $release) { echo $release->summary . PHP_EOL; } P.S. The above is based on using the Discogs API, which it looks like you're using.
  18. You can match a space character by typing a space character (unless the PCRE_EXTENDED pattern modifier is used), or by using a backslash escape sequence to represent that character by its ASCII value. These are basic regexes that will match a space: / / and /\040/ (octal ASCII value, also /\40/ provided there are fewer than 40 previous capturing subpatterns) and /\x20/ (hexadecimal ASCII value). In contrast, the \s will match more than just the space character; it matches Horizontal Tab, Line Feed, Form Feed, Carriage Return and Space.
  19. Can you give an example of the XML that you're trying to make sense of (echo $result->asXML()) and the information that you are trying to access within the loop?
  20. Show us how you are looping over the file (if you are), to give us some context to work within.
×
×
  • 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.