Téma: PHP |
|
|
|
R.András |
|
Sorting Arrays PHP has several functions that deal with sorting arrays, and this document exists to help sort it all out. The main differences are: * Some sort based on the array keys, whereas others by the values: $array['key'] = 'value'; * Whether or not the correlation between the keys and values are maintained after the sort, which may mean the keys are reset numerically (0,1,2 ...) * The order of the sort: alphabetical, low to high (ascending), high to low (descending), numerical, natural, random, or user defined * Note: All of these sort functions act directly on the array variable itself, as opposed to returning a new sorted array * If any of these sort functions evaluates two members as equal then the order is undefined (the sorting is not stable). ... www.php.net/manual/en/array.sorting.php |
|
|
|
|
R.András |
|
strpos — Find the position of the first occurrence of a substring in a string int strpos ( string $haystack , mixed $needle [, int $offset = 0 ] ) Returns the position of where the needle exists relative to the beginning of the haystack string (independent of offset). Also note that string positions start at 0, and not 1. Returns FALSE if the needle was not found. ... http://php.net/manual/en/function.strpos.php |
|
R.András |
|
$psize['a'] = 123; $psize['b'] = 234; var_dump( $psize );
|
|
|
|
|
|
|
Rendes Kis |
|
In addition to the basic assignment operator, there are "combined operators" for all of the binary arithmetic, array union and string operators that allow you to use a value in an expression and then set its value to the result of that expression. For example: <?php
$a = 3; $a += 5; // sets $a to 8, as if we had said: $a = $a + 5; $b = "Hello "; $b .= "There!"; // sets $b to "Hello There!", just like $b = $b . "There!";
?> ... http://www.php.net/manual/en/language.operators.assignment.php |
|
|
|
|