Indlæg tagget ‘PHP’

Fast way to find the difference between two numbers

< ?php
function diff($a, $b) {
return ($a < $b) ? ($b - $a) : ($a - $b);
}
?>

Update: Apparently I was to tired when I wrote this, a lot faster method is like Søren mentions: abs($a-$b) :)

Læst resten af dette indlæg »

Howto use Eclipse with PHP and SVN in Ubuntu 9.10

This little guide will show how to set up Eclipse for developing PHP sites using PHP Development Tools Project and Subversion.

Læst resten af dette indlæg »

PHP highlight bug in jEdit

For a long time, I have been experiencing a bug in the PHP highlightning in jEdit. The problem is when writting something like
$foo = “bar\””;
the highlightning ignores \” and start looking for the ending of the “”.
This page gives the answer to my problem.
In Ubuntu Feisty Fawn, with jEdit installed with the Java-installer, the file [...]

Læst resten af dette indlæg »