Shortcut to the main page: Alt + Shift + upper 2(@)
Linkedin FB e-mail Google Plus Twitter

Search in this website

Language versions are not identical,
so visit all versions,
which you can understand.

Scripts and functions in PHP (+ SQL, JS)

PHP: Explode function alternative

PHP: Script for substitution of explode function - allows to split a string by words and save them as an array elements (values). This algorithm (in comparison to explode function) allows to set whole array of delimiters at once (dot, exclamation mark, question mark, etc.) and keep an information about them.


PHP: Random sample of images

PHP function for random selection of requested number of files (or all) having entered extensions from entered directory at the server (webhosting). Typically for selection and insertion of needed number of random images.


PHP: Recalculate image size

PHP function for calculation of new size of image due to limits for maximal width and height. Keeps aspect ratio.


HTML Convertor

HTML converter:

For escaping of HTML tags, ampersands and quotation marks

for adding of HTML tags for new line <br />

for removing of HTML tags

for adding of non breaking spaces for Czech and Polish language (as much as possible) and to change short hyphen - to long dash –

for removing of Czech and Polish diacritic when keeping original basic character.



Jump up to: Navigation menu
(keyboard shortcut Alt + Shift + „5”)

Are you interested by this page?

  • Add to bookmarks (Ctrl+D)
  • Share link (CB radio)Jump up to:
  • Print (Ctrl+P)
  • Cite according to ISO 690

    This page

    ADÁMEK, Martin. Scripts and functions in PHP (+ SQL, JS). Martin Adámek [online]. Náchod / Meziměstí (Czech Republic) [cited 2024-07-23]. Available from:

    Whole site

    ADÁMEK, Martin. Martin Adámek [online]. Náchod / Meziměstí (Czech Republic) [cited 2024-07-23]. Available from:



National Cultural Heritage

WebArchiv – This website is being archived by the National Library of the Czech Republic This website is regularly archived by the National Library of the Czech Republic for its cultural, educational, scientific, research or other values with the aim of documenting an authentic sample of the Czech web. It belongs to a collection of Czech websites to be preserved by the National Library and made available for posterity. Its record is included in the Czech National Bibliography and the National Library catalogue.  



For a distraction

Why do all Assembler programmers want to live in Atlantis?
Because it is below C level.


For a muse

Whether you think you can, or you think you can't – you're right.
[Henry Ford]