PHP
php.net › manual › en › function.end.php
PHP: end - Manual
<?php private function extension($str){ $str=implode("",explode("\\",$str)); $str=explode(".",$str); $str=strtolower(end($str)); return $str; } // EXAMPLE: $file='name-Of_soMe.File.txt'; echo extension($file); // txt ?> Very simple.
PHP
prototype.php.net › manual › en › function.end.php
PHP: end
Example #1 end() example · <?php $fruits = array('apple', 'banana', 'cranberry'); echo end($fruits); // cranberry ?> current() - Return the current element in an array · each() - Return the current key and value pair from an array and advance the array cursor ·
W3Schools
w3schools.com › php › func_array_end.asp
PHP end() Function
json_decode() json_encode() json_last_error() PHP Keywords · abstract and as break callable case catch class clone const continue declare default do echo else elseif empty enddeclare endfor endforeach endif endswitch endwhile extends final finally fn for foreach function global if implements include include_once instanceof insteadof interface isset list namespace new or print private protected public require require_once return static switch throw trait try use var while xor yield yield from PHP Libxml
PHP
us2.php.net › end
PHP: end - Manual
It's interesting to note that when creating an array with numeric keys in no particular order, end() will still only return the value that was the last one to be created. So, if you have something like this: <?php $a = array(); $a[1] = 1; $a[0] = 0; echo end($a); ?> This will print "0".
Jobtensor
jobtensor.com › Tutorial › PHP › en › Array-Functions-end
PHP Built-in end(), Definition, Syntax, Parameters, Examples | jobtensor
<?php // Example 1 $cities = array("New York", "Salt Lake", "Tokyo"); echo current($cities) . "<br>"; echo end($cities) . "<br>"; // Examples in conjuction with other related functions $ages = array("Mark" => 22, "Jeff" => 32, "Mike" => 28); echo current($ages) .
Tutorialspoint
tutorialspoint.com › php › php_function_end.htm
PHP - Function end()
The end() function advances array's internal pointer to the last element, and returns its value. It returns the last element in an array. Try out following example − · <?php $transport = array('foot', 'bike', 'car', 'plane'); $mode = current($transport); print "$mode <br />"; $mode = next($transport); print "$mode <br />"; $mode = current($transport); print "$mode <br />"; $mode = prev($transport); print "$mode <br />"; $mode = end($transport); print "$mode <br />"; $mode = current($transport); print "$mode <br />"; ?> This will produce the following result − ·
W3Schools
w3schools.com › php › func_misc_exit.asp
PHP exit() Function
json_decode() json_encode() json_last_error() PHP Keywords · abstract and as break callable case catch class clone const continue declare default do echo else elseif empty enddeclare endfor endforeach endif endswitch endwhile extends final finally fn for foreach function global if implements include include_once instanceof insteadof interface isset list namespace new or print private protected public require require_once return static switch throw trait try use var while xor yield yield from PHP Libxml
Top answer 1 of 5
17
It's the start of a heredoc. you can do:
$data = <<< _END
You can write anything you want in between the start and end
_END;
_END can be just about anything. You could put EOF or STUFF. as long as you use the same thing at the start and the finish.
2 of 5
3
This signifies the beginning of a heredoc (a multi-line string that allows you to use quotation marks in the middle, unescaped) that ends when you encounter the _END
It can be useful to define HTML in one of these if the goal is to assign it to a variable or pass it to a function rather than printing it to the web server immediately.
ZetCode
zetcode.com › php-array › end
PHP end - Array Pointer in PHP
The function takes an array parameter by reference. It modifies the internal pointer position. This demonstrates getting the last element of a simple indexed array. ... <?php $fruits = ['apple', 'banana', 'cherry']; $lastFruit = end($fruits); echo "The last fruit is: $lastFruit";
O'Reilly
oreilly.com › library › view › php-in-a › 0596100671 › re49.html
exit() - PHP in a Nutshell [Book]
October 13, 2005 - Content preview from PHP in a Nutshell · exit() void exit ( [mixed status] ) The exit() function takes just one optional parameter and immediately terminates execution of the script.
Author Paul Hudson
Published 2005
Pages 372