Jump to content

salathe

Staff Alumni
  • Posts

    1,832
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by salathe

  1. See this blog post from the guy who maintains PHPs date/time related functions: http://derickrethans.nl/obtaining-the-next-month-in-php.html
  2. Were you really hoping for us to come along and say, "Easy, framework XYZ is best."? Without context, it is not even possible to steer towards frameworks that might be useful to you, never mind the best of those! Is it the best at washing the dishes? Please, if you're going to make claims of suitability then at least be informative with it. P.S. quit spamming.
  3. "sentence test&new".replace(/(.*)&/, "")
  4. cost($this) is calling the cost method of the $this->costStrategy object (an instance of the CostStrategy class), and passing along the current object ($this, see docs)) as the first and only argument to that method.
  5. From your description it sounds like you've got all of the pieces clear in your head. What in particular are you having trouble understanding?
  6. You could also skip the regex and use plain old string functions. (strlen($blah) === 32 && ctype_xdigit($blah))
  7. chicago, you never end this block: if ($_SESSION['username']=='login') {
  8. If all that you need is the date-fansite string, you can instead use the evaluate method with an XPath query which asks for the relevant string. An example would look like: $data = $xpath->evaluate('string(//div[@class="talentcalc-info"]/div[@class="third-party"]/a/@data-fansite)');
  9. There may well be, since you're clearly having trouble with regular expressions. However the easier alternative will likely vary depending on the type of problem that you are looking to solve; who knows, maybe regex isn't suited to what you wanted to do anyway.
  10. What is the column type of your end_date column? Remember that you're giving it a Unix timestamp (an integer, the number of seconds since 1 Jan 1970) and that may well be different from what MySQL expects. The date/time formats are well documented (though can be a lot to digest, and lack version changes/information).
  11. Lets hear it for a dojo section too!... *pause* ... aww.
  12. Sure, each SimpleXMLElement object has two methods for retrieving namespaces: getDocNamepaces and getNamespaces. You can loop over the return value from whichever of those you like most, registering them one at a time.
  13. Since the XML document has a default namespace (for Atom), you need to tell XPath that it exists and in your query you need to ask for link elements within that default namespace. Since you're looking for only the next link of the feed (I'm guessing you don't want any from the entries) then there's also no need for // in the XPath query. $xml->registerXPathNamespace('atom', 'http://www.w3.org/2005/Atom'); $next = $xml->xpath("atom:link[@rel='next']");
  14. Default values for function parameters cannot be function calls. If you need them to be dynamic, do something like: function conectar_bd($nombre_bd = NULL, $host = NULL, $usuario = NULL) { if ($nombre_bd === NULL) { $nombre_db = $reg->getConf("Nombre bd"); } // Repeat for other parameters }
  15. Use call_user_func_array() until you can identify (with real numbers and pretty bar charts) that it is becoming a problem area for your script/application, if that point ever arrives.
  16. The examples on the page that I linked to didn't help at all?
  17. Have a look through the basic SimpleXML examples, and if you're having trouble post a sample of the XML itself for us to help you with.
  18. No the timezone is not based on where you live, but instead based on settings in PHP and/or the server's operating system. The usual way of "deciding" the default timezone is to set the date.timezone setting in the php.ini file. See the documentation for the date_default_timezone_get() function, which lists the available places (and order of preference) where the timezone can be configured.
  19. Urgh, why make it in entirely the wrong forum? I guess it slipped under my radar (was on vacation ) and I would never have thought to look in there for an announcement!
  20. Before offering up a hand with the decimals, are you aware that your current regular expression only makes sure that the price has a single digit or whitespace character (space, tab, etc.) but can contain any other characters as well? For example "this is not a number" will be accepted! Can you see why? Have you had a stab at allowing decimals yourself? Either way, take a moment to browse around a reference site [1] and try to familiarize yourself with the regex approach to problem solving (not everyone gets it). Have a stab at it yourself; folks here much prefer teaching people to fish (or, code) over giving others a free meal (though, if you're lucky!). [1] E.g. http://www.regular-expressions.info
  21. *salathe puts forward a motion to promote cssfreakie just to see what happens
  22. It would have been nice to announce this sort of thing; mostly to show that the place is being looked after, but also to celebrate the awesome new features available (are there any?). P.S. Apologies for wandering off topic!
×
×
  • 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.