Jump to content

salathe

Staff Alumni
  • Posts

    1,832
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by salathe

  1. It's hardly a fork at all, that name was given primarily to attract visitors (from what I've read). Some of the changes would be nice, others very welcome, others not so much at all. It would be worth mentioning that his approach sucked (publishing the changes without even attempting to talk to the PHP guys about merging them) but he has since come along and offered them up for discussion within PHP. Open source works best if the changes can flow upstream.
  2. Look in Zend/zend_highlight.c (and Zend/zend_language_scanner.c if you want your mind melted).
  3. Have a look at profiling your script (search "xhprof", "xdebug") to find out really where the slow parts of the script lie, rather than guessing.
  4. The function may be "slow" depending on the regular expression and replacements being made, though in most normal cases it is not "slow" at all. Have a look at profiling your script (search "xhprof", "xdebug") to find out really where the slow parts of the script lie, rather than guessing.
  5. You could also just use magic. $string = preg_replace('/function\h+\K[^(\h]+/i', '<span class="function-name-of-awesomeness">$0</span>', $string);
  6. You can use the web chat (http://webchat.freenode.net/), just enter your nick name (smallzoo is fine) and the channel (#ppi). Nope, not a sausage.
  7. Have a chat with the PPI developers, they hang out on IRC (irc.freenode.net #ppi, web chat). For what it's worth, I run PPI on the latest PHP 5.3. Maybe there is some setup and/or configuration issue.
  8. You decode the JSON once, then try to decode the result of decoding twice! Instead, just decode the result from file_get_contents(). $jsonFile = file_get_contents('http://api.xxxxxx.com/xxxxxxx.json?client_id=975a48c6c927c42c91cxc2348eafc9766d44892d'); var_dump(json_decode($jsonFile)); var_dump(json_decode($jsonFile, true));
  9. Around 15 years, give or take -- the early years are a little fuzzy. The amount of coding has gradually increased with time, now it occupies my working life and a significant portion outside of that.
  10. PHP has a bunch built in, see http://php.net/refs.xml and look at classes like XMLReader, SimpleXML and DOMDocument.
  11. Further to mikesta707's link, see also http://php.net/simplexml.examples-basic for a guide to the basic usage of SimpleXML. Post back if you have further questions.
  12. Sorry to break this to you but, it is not an array; the print_r() output lies. SimpleXMLElement objects are Traversable, so you can loop over them but they're not arrays. Given the output from print_r(), you should be able to use foreach($Obj->SellerListing as $Item) { // blah blah --- if that does not work, then please show the XML that you're working with (echo $Obj->saveXML();). P.S. Welcome to PHPFreaks.
  13. Don't PM the XML! If you want help, please post relevant information publicly.
  14. When PHP is compiled with libxml, the constant LIBXML_DOTTED_VERSION is available which contains the version like 2.6.17. There is also LIBXML_VERSION which is without dots, 20617.
  15. You can use attributes() to access the attributes for each item.
  16. This topic has been moved to Other Programming Languages. http://www.phpfreaks.com/forums/index.php?topic=335385.0
  17. Can you show the full schema and full XML? Edit: For what it's worth here are a few problems I can see: 1. quantity/owned/etc. should be attributes (not child elements) 2. productId should be productID 3. the id attribute isn't allowed (in the partial schema you gave) As for the union in there, all it means is that the lineItem can contain either some text (a price between 0 and 99999999.99) or no text. Thanks
  18. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=335287.0
  19. There are some things in this world that one is better off not knowing.
  20. I bribed an admin, have a mac and was never nominated... so, anything can happen. An alternative is to be so good at finding spam messages, or posts in the wrong forum, and clicking "Report to moderator" that the current moderators get annoyed with you and let you deal with the posts yourself. But that involves effort!
  21. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=335174.0
  22. If you want just the first entry's link, then the following is the SimpleXML way (putting the simple back in there). $xml = simplexml_load_file('http://video.news.com.au/feed.atom'); echo $xml->entry->link['href'];
  23. For the content type, just send the header that I gave you (copy and paste!). No need for meta tags, as those are part of HTML and you're creating JSON. The jQuery docs are pretty awesome, but you do have to know what you're looking for sometimes.
  24. Be sure that your PHP scripts tells browsers that the response is JSON (e.g. header("Content-Type: application/json");). It's also a good idea to tell jQuery to expect a JSON response in your $.ajax() options (e.g. dataType: "json").
×
×
  • 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.