Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | function getImageDirName($photoid, $type = 'user_photo' ,$collectionNum =1000) |
||
13 | { |
||
14 | $folderName = null; |
||
15 | switch ($type) { |
||
16 | case 'user_photo': |
||
17 | $folderName = (int) ($photoid / $collectionNum); |
||
18 | $folderName++; |
||
19 | $dir = 'user_photo/'.$folderName.'/'; |
||
20 | break; |
||
21 | } |
||
22 | |||
23 | if ($folderName) { |
||
|
|||
24 | $folderName = $dir; |
||
25 | } |
||
26 | |||
27 | return $folderName; |
||
28 | } |
||
42 | } |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
integer
values, zero is a special case, in particular the following results might be unexpected: