Search
using php parse_url function to remove the query string from a url
I recently had to remove the query string from a url, the bit after the ?key=1 or whatever is after the actual url. I initially thought i could just use a explode function on the ? which would ..
generate random username function in php
a function that takes several random words and creates a user name from them. This will generate a user name with between one to three words and a prefix if prefix_show is set to true. usage generat..
split a string into links using the comma
this is a common function for some field data, lets say you have a string like this. category one, category two, another category in one field or string but i want it to display like this category ..
php basic page router
this php page router while pretty basic does the job for this site. it takes all the query string and splits it with the / into $p variables you will also need the following nginx or similar page rew..
explode a string into an array
This uses the php explode function to split a string into an array based on a delimiter character. I always forget which order this goes in.
linking search results to view pages [finished] 🤣
I was thinking it might be useful to link the search term to the page, so that it can be found more easily using that search. For example, Link this search text (somehow) to the post page and display..
Quick tool to convert time into decimal
I needed a quick tool that can convert say 20 minutes into decimal, as im doing this a lot these days. Here is what i come up with, well you can google it as well and that works, but this form is a bi..
page load timer class
usage: $page_timer = new page_timer; // at the start of your code echo $page_timer->end(); // at the end of your code.
assign array to variables in a loop
this will assign all items in the array to variables $p1,$p2.. etc. $p = "/1/2/3/4/5/"; $page_array = explode("/",$p); foreach ($page_array as $key => $value) { if($value > "") { ${"p".$pc..
using parse_url to extract parts of a url
Category: PHP the parse_url php function will split a url into an array of url fragments $url = "http://kruxor.com/path/?argument=value#anchor"; var_dump(parse_url($url)); parse_url example ..