PHP usort not working or running or happening?
If you are using in a class, make sure:
usort($results, array(“MASSAGESTATS_Admin”,”j_cmp_revenue”));
http://stackoverflow.com/questions/6419818/php-usort-wont-sort
and also try static.
If you are using in a class, make sure:
usort($results, array(“MASSAGESTATS_Admin”,”j_cmp_revenue”));
http://stackoverflow.com/questions/6419818/php-usort-wont-sort
and also try static.
http://stackoverflow.com/questions/3577641/how-do-you-parse-and-process-html-xml-in-php
[code]
function cfriend_get_href_links($html) {
// Create a new DOM Document to hold our webpage structure
$xml = new DOMDocument();
// Load the url’s contents into the DOM
$xml->loadHTML($html);
// Empty array to hold all links to return
$links = array();
//Loop through each <a> tag in the dom and add it to the link array
foreach($xml->getElementsByTagName(‘a’) as $link) {
$links[] = array(‘url’ => $link->getAttribute(‘href’), ‘text’ => $link->nodeValue);
}
//Return the links
return $links;
}
http://stackoverflow.com/questions/1267999/mysql-better-to-insert-null-or-empty-string
I Personally use NULL for more powerful results..
By using NULL you can distinguish between “put no data” and “put empty data”.
Some more differences:
A LENGTH of NULL is NULL, a LENGTH of an empty string is 0.
NULLs are sorted before the empty strings.
COUNT(message) will count empty strings but not NULLs
You can search for an empty string using a bound variable but not for a NULL. This query:
SELECT *
FROM mytable
WHERE mytext = ?
will never match a NULL in mytext, whatever value you pass from the client. To match NULLs, you’ll have to use other query:
SELECT *
FROM mytable
WHERE mytext IS NULL
Since money needs an exact representation don’t use data types that are only approximate like float. You can use a fixed-point numeric data type for that like
numeric(15,2)
15 is the precision (total length of value including decimal places)
2 is the number of digits after decimal point
See MySQL Numeric Types:
These types are used when it is important to preserve exact precision, for example with monetary data.
I personally use numeric(19,4) for financial records that gives you a better hand to play and adopt new requests easily.
See: http://codepen.io/netsi1964/pen/IoJbg
and: http://joelb.me/blog/2011/code-snippet-accessing-clipboard-images-with-javascript/
jquery:
https://github.com/vladmalik/pasteimage
pasteboard.co
http://www.smashingmagazine.com/2013/02/remove-interface-elements/
http://stackoverflow.com/questions/2215354/php-date-format-when-inserting-into-datetime-in-mysql
date(“Y-m-d H:i:s”)
As seen in doc:
https://ellislab.com/codeigniter/user-guide/helpers/date_helper.html
Set time_reference in config.php to ‘gmt’ and use the Date class, if you intend to let users set their own timezone settings.