-
Posts
1,832 -
Joined
-
Last visited
-
Days Won
3
Everything posted by salathe
-
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.
-
Look in Zend/zend_highlight.c (and Zend/zend_language_scanner.c if you want your mind melted).
-
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.
-
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.
-
You could also just use magic. $string = preg_replace('/function\h+\K[^(\h]+/i', '<span class="function-name-of-awesomeness">$0</span>', $string);
-
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.
-
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.
-
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));
-
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.
-
-
PHP has a bunch built in, see http://php.net/refs.xml and look at classes like XMLReader, SimpleXML and DOMDocument.
-
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.
-
SimpleXmlElement which contains an array... how to get it!
salathe replied to digitaldanuk's topic in PHP Coding Help
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. -
Don't PM the XML! If you want help, please post relevant information publicly.
-
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.
-
You can use attributes() to access the attributes for each item.
-
This topic has been moved to Other Programming Languages. http://www.phpfreaks.com/forums/index.php?topic=335385.0
-
create XML from schema with union.
salathe replied to kevinh448's topic in Other Programming Languages
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 -
There are some things in this world that one is better off not knowing.
-
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!
-
This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=335174.0
-
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'];
-
Ajax post/get and returned json_encoded php array
salathe replied to viviosoft's topic in Javascript Help
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. -
Ajax post/get and returned json_encoded php array
salathe replied to viviosoft's topic in Javascript Help
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").