php Programming Glossary: codepad
PHP integer part padding http://stackoverflow.com/questions/11383597/php-integer-part-padding use printf functions to pad the integer Something like codepad php function pad n n explode '.' string n if 2 count n return..
Why are floating point numbers printed so differently? http://stackoverflow.com/questions/14082287/why-are-floating-point-numbers-printed-so-differently And why is it also inconsistent in Ruby version 1.8.6 codepad gives 0.1 version 1.9.3 ideone gives 0.0999... php javascript..
How does similar_text work? http://stackoverflow.com/questions/14136349/how-does-similar-text-work added some output so one can see what is happening there codepad link #include stdio.h php_similar_str static void php_similar_str..
Parsing JSON file with PHP http://stackoverflow.com/questions/4343596/parsing-json-file-with-php
php count xml elements http://stackoverflow.com/questions/4386465/php-count-xml-elements XML only use a direct path. Full working example run on codepad xml XML root NotOfferNameList OfferName ... OfferName OfferName..
How can I use XPath and DOM to replace a node/element in php? http://stackoverflow.com/questions/4614434/how-can-i-use-xpath-and-dom-to-replace-a-node-element-in-php dom oldNode xp query ' div @id old_div ' item 0 Demo on codepad To create a newNode with child nodes without having to to create..
Unexpected T_PAAMAYIM_NEKUDOTAYIM in PHP 5.2.x http://stackoverflow.com/questions/4995540/unexpected-t-paamayim-nekudotayim-in-php-5-2-x php 5.2 share improve this question After looking at codepad if is_object result true result id strval xpto ... should be..
What is the PHP regex to convert text containing a URL into a hyperlink? http://stackoverflow.com/questions/5024126/what-is-the-php-regex-to-convert-text-containing-a-url-into-a-hyperlink href http www.foo.com target _blank the fence a Tested on codepad . EDIT Updated code to match new requirements share improve..
Combine days where opening hours are similar http://stackoverflow.com/questions/5906984/combine-days-where-opening-hours-are-similar
Ignore html tags in preg_replace http://stackoverflow.com/questions/8193327/ignore-html-tags-in-preg-replace expressions at all. You find the full code here http codepad.viper 7.com U4bxbe including the TextRange class that I have.. answers example . It's not working properly on the viper codepad because of an older LIBXML version that site is using. It works..
XPath query result order http://stackoverflow.com/questions/8195733/xpath-query-result-order code that works on my development machine but not on viper codepad where I tested it before adding it to my answer. I could reduce.. by DOMXPath query differs between my system and the codepad. XML test This is some span text span fine. test When I query..
Wordwrap / Cut Text in HTML string http://stackoverflow.com/questions/8482339/wordwrap-cut-text-in-html-string saveHTML node The full code example is available on viper codepad incl. the TextRange class. The codepad has a bug so it's result.. available on viper codepad incl. the TextRange class. The codepad has a bug so it's result is not properly Related XPath query..
Warning: preg_match(): Internal pcre_fullinfo() http://stackoverflow.com/questions/8859363/warning-preg-match-internal-pcre-fullinfo print_r array int matches However when I execute it on codepad I get the error Warning preg_match Internal pcre_fullinfo error.. break depending on some config. So what is the reason codepad breaks on it php regex codepad share improve this question.. So what is the reason codepad breaks on it php regex codepad share improve this question Code executed via codepad is..
PHP - Need to remove duplicate characters within a String but would like to include exceptions http://stackoverflow.com/questions/10761403/php-need-to-remove-duplicate-characters-within-a-string-but-would-like-to-incl
Break up PHP Pagination links http://stackoverflow.com/questions/2844456/break-up-php-pagination-links
Can I share variables between different functions in PHP? http://stackoverflow.com/questions/3898170/can-i-share-variables-between-different-functions-in-php second a b a Outputs First 1 second 2 Try it out at this Codepad example or probably more useful php function a a 1 echo First.. to a fun Outputs First 1 second 2 Try it out at this Codepad example From the docs Closures may also inherit variables from..
Grab all Wednesdays in a given month in PHP http://stackoverflow.com/questions/4293174/grab-all-wednesdays-in-a-given-month-in-php echo date l Y m d n wednesday Same output as above Run on Codepad . Note that this does not work for any version prior to 5.3..
delete child node in xml file with php http://stackoverflow.com/questions/4667433/delete-child-node-in-xml-file-with-php id child node having the value stored in id . Run code on Codepad . More examples remove element from xml share improve this..
Is this correct object oriented programing in php? [closed] http://stackoverflow.com/questions/5329664/is-this-correct-object-oriented-programing-in-php echo john greet jane PHP_EOL jane greet john Live Demo on Codepad Granted that's quite a lot of code for a very simple thing to..
Why is array_key_exists 1000x slower than isset on referenced arrays? http://stackoverflow.com/questions/6337893/why-is-array-key-exists-1000x-slower-than-isset-on-referenced-arrays 4.12856411934 ~ what on earth I'm on PHP 5.3.6. Codepad example . php performance reference isset array key exists..
Getting nested set model into a <ul> but hiding “closed” subtrees http://stackoverflow.com/questions/7729173/getting-nested-set-model-into-a-ul-but-hiding-closed-subtrees The MyRenderTree function Demo Full code Edit The Demo Codepad has problems here is the source code Gist Getting nested set..
XPath query result order http://stackoverflow.com/questions/8195733/xpath-query-result-order I query all textnodes child text the result differs Viper Codepad #0 This is some #1 fine. #2 text My Machine #0 This is some.. that LIBXML_VERSION differs between the two systems Viper Codepad 20626 2.6.26 6 Jun 2006 My Machine... 20707 2.7.7 15 Mar 2010..
|