This is a PHP function I made to create an array from a query string parameters and values. I did this with the idea that a parameter could have multiple values separated by a semicolon.
This function can take a normal string and turn it into a slug (just like it does with WordPress post titles).
Sometimes it is necessary to trim a string at a certain point to show a snippet of content available on another page like a blog post, or to ensure it will fit into a design. This function can truncate a string by words or characters.