PHP and writing clean code

Posted by Pirkka on Stack Overflow See other posts from Stack Overflow or by Pirkka
Published on 2010-05-05T06:08:50Z Indexed on 2010/05/05 6:18 UTC
Read the original article Hit count: 436

Filed under:
|
|

Hello

Im trying to find best practices to write PHP.

I just wonder is this a bad habit.

For example, processing variables.

$var = 1
$var = doSomething($var);
$var = doSomething2($var);
$var = doSomething3($var);

It looks a bit awful.

Here is a example of a real code that I just did:

$this->rSum = explode(",", $this->options["rSum"]);
$this->rSum = array_combine(array_values($this->rSum), array_fill(0, count($this->rSum), 0));

If someone could pass me some good tutorials of writing cleaner code generally it would be nice!

Its me again asking stupid questions. :)

© Stack Overflow or respective owner

Related posts about php

Related posts about clean