Skip to main content
Post Made Community Wiki by Dennis
added 14, 15 and 16
Source Link
Titus
  • 14.8k
  • 1
  • 24
  • 41

Length 16

The function

http_build_query

builds a query string for an URI from an associative array.
One of many functions that´s closely connected to web development.

Length 15

array_intersect

This function returns the common elements of two or more arrays.

Array function names in PHP are bulky. Apart from implode and explode (respectively join and split), they are almost always prefixed.

Length 14

imagefilledarc

Since version 4.0.6, php has builtin image processing with some pretty sophisticated functions. imagefilledarc is one of them. It can be used e.g. for painting a three dimensional pie chart.

Length 13

Length 13

Length 16

The function

http_build_query

builds a query string for an URI from an associative array.
One of many functions that´s closely connected to web development.

Length 15

array_intersect

This function returns the common elements of two or more arrays.

Array function names in PHP are bulky. Apart from implode and explode (respectively join and split), they are almost always prefixed.

Length 14

imagefilledarc

Since version 4.0.6, php has builtin image processing with some pretty sophisticated functions. imagefilledarc is one of them. It can be used e.g. for painting a three dimensional pie chart.

Length 13

Lenght 13 - if($a >= $b): - PHP Alternative Syntax for Control Structures
Source Link

Length 13

if($a >= $b):

This is the alternative syntax for control structures, which ends when it finds a endif; statement. This syntax can be used with if, while, for, foreach, and switch, and end with endif; endwhile; endfor; endforeach; or endswitch; respectively. This alternative syntax is most used to output html without echoing html tags:

<?php foreach($items as $item): ?>
<p><?php echo $item; ?></p>
<?php endforeach; ?>

Length 12

Length 12

Length 13

if($a >= $b):

This is the alternative syntax for control structures, which ends when it finds a endif; statement. This syntax can be used with if, while, for, foreach, and switch, and end with endif; endwhile; endfor; endforeach; or endswitch; respectively. This alternative syntax is most used to output html without echoing html tags:

<?php foreach($items as $item): ?>
<p><?php echo $item; ?></p>
<?php endforeach; ?>

Length 12

added 377 characters in body
Source Link
Kokizzu
  • 1.5k
  • 11
  • 20

Length 12

function(){}

This is an example of anonymous function, that can be assigned to a variable, or passed as parameter, for example:

$cmp = function($a,$b) {
  if($a<$b) return -1;
  if($a>$b) return 1;
  return 0;
};
$arr = array(3,1,2);
usort($arr,$cmp);
print_r($arr); // array( [0] => 1, [1] => 2, [2] => 3 )

Length 11

Length 11

Length 12

function(){}

This is an example of anonymous function, that can be assigned to a variable, or passed as parameter, for example:

$cmp = function($a,$b) {
  if($a<$b) return -1;
  if($a>$b) return 1;
  return 0;
};
$arr = array(3,1,2);
usort($arr,$cmp);
print_r($arr); // array( [0] => 1, [1] => 2, [2] => 3 )

Length 11

deleted 1 character in body
Source Link
Kokizzu
  • 1.5k
  • 11
  • 20
Loading
added 140 characters in body
Source Link
Kokizzu
  • 1.5k
  • 11
  • 20
Loading
added 600 characters in body
Source Link
Kokizzu
  • 1.5k
  • 11
  • 20
Loading
added 100 characters in body
Source Link
Kokizzu
  • 1.5k
  • 11
  • 20
Loading
added 160 characters in body
Source Link
Kokizzu
  • 1.5k
  • 11
  • 20
Loading
added 535 characters in body
Source Link
Kokizzu
  • 1.5k
  • 11
  • 20
Loading
added 358 characters in body
Source Link
Kokizzu
  • 1.5k
  • 11
  • 20
Loading
added 208 characters in body
Source Link
Kokizzu
  • 1.5k
  • 11
  • 20
Loading
added 825 characters in body
Source Link
Kokizzu
  • 1.5k
  • 11
  • 20
Loading
added 186 characters in body
Source Link
Kokizzu
  • 1.5k
  • 11
  • 20
Loading
added 308 characters in body
Source Link
Kokizzu
  • 1.5k
  • 11
  • 20
Loading
Source Link
Kokizzu
  • 1.5k
  • 11
  • 20
Loading