Problem I’m looking to pull all the youtube links from a string of text and was wondering how does this […]
Tag: url
Removing everything after a certain character
Problem I was just writing code, and wanted to make a piece that removes everything after the character ? if […]
Remove a parameter and its value from URL’s query string
Problem I’m coding an algorithm to remove a parameter (let’s call it foo) from URL strings. Of course, after the […]
Return the first word in the image name
Problem I just want to return the first word in the image name (before the dash, dog in my example). […]
URL whitelist class
Problem I’m trying to make a class for safe redirection of URLs. Redirecting URLs is something you can have in […]
Git commit-msg URL shortener
Problem I have just written my first git hook script. It is very simple that simply finds any URLs in […]
Extracting a number from provided URLs inside a text file
Problem I need to extract a ID (int number) from a Url. Example: http://www.example.com/foo/bar/12345 For this I wrote 4 methods […]
Determine base URL of PHP app
Problem I have this little piece of code which determines the base URL of PHP: $root = $_SERVER[“SERVER_NAME”]; if(basename(__FILE__) !== […]
HTTP request path parser
Problem I have written a method to tokenize HTTP request paths such as /employee/23/edit: protected void compile(String path){ int mark=0; […]
Parse a clean slug URL
Problem I have to implement a “user-friendly” URL for an employment website. The URL /jobs{parameters?} may be composed of up […]