Search
Search Code
Search Code by entering your search text above.
php functions
show views list function

list items by the view count

10:52 pm, April 12, 2023
php functions
list page links function list_page_links

list top number of page links from selected table test run time on db of 4k items.  select * from pages where publish = 'publish' order by insdate desc limit 10 10 rows (0.005 s)

10:48 pm, April 12, 2023
php functions
Return a file extention from a string

This php function returns a file extention from a string.  I think it will only work if the string does not have any additional . in it.  I think a better way to do this function would be ..

5:45 am, April 7, 2023
php functions
shorten string php, string length php, clip string length php

I'm pretty sure i have done this function before but i cant find it due to the keywords being wrong! Here is a function that takes a string and shortens it and adds .. to the end, with the rest of th..

2:38 am, October 3, 2022
php functions
get file name from path name in php

returns the file name from a full url or path in php, using basename function. 

1:03 am, September 30, 2022
php functions
imgur upload from php

function that takes an image and uploads it to imgur using a client api id, and then returns all the data. i did this one ages ago and did not make it into a function, but this version should work as..

12:45 am, September 30, 2022
php functions
simplepie error : XML or PCRE extensions not loaded!

using simplepie it does not load the target feed, and does not display any errors. Just nothing.  if your feed is init'd with $feed check for feed errors with:        $feed ..

4:01 am, September 29, 2022
php functions
loading a non processed item using the load_from_fields_array function

Example using the load_from_fields_array function  to load a single item where the processed value is equal to FALSE.

3:14 am, September 23, 2022
php functions
simple file cache and check in php

just a quick cache bit of code, may need tweaking to actually work... i just added it here as i thought it was re-usable.  Also requires simple_html_dom library.

6:45 am, September 19, 2022
php functions
loop through $_GET in php

I thought this one would be something like PHP foreach($_GET) { echo $_GET; } but actually as $_GET is an array you need to do the $key and $value loop like this PHP foreach ($_GET as $..

12:01 am, August 29, 2022
php functions
php strip non numbers from string - remove all non-numeric characters from a string

this will remove all non alpha numeric numbers from a string. in this example it returns: 123456 from $1234.56x  

1:00 pm, August 24, 2022
php functions
get string between other strings function php

So it turns out that i have had this issue before of finding a string in between other strings and made a function for it that i forgot about. 

5:00 am, June 24, 2022
php functions
php validate email function

php function that can be used to validate an email address string

1:59 am, June 12, 2022
php functions
convert a string into its html entitles using php htmlentities function

this takes a html string such as the following example and converts it into its html entities. it will take a character such as < and convert it into &lt; so that the string is not parsed as h..

8:48 am, February 19, 2022
php functions
make a nice readable date using a timestamp string function make_nice_date

handy if you have a timestamp like this: 2022-01-10 00:12:42 and want it to look a bit nicer. like this... 12:19 am, January 10, 2022

12:12 am, January 10, 2022
php functions
get php to validate its self with php check syntax

Did you know that php has a syntax checking function built into it? Well it does and this is how you can use it to check your php files for errors, rather than just running them and hoping for the be..

5:45 am, December 1, 2021
php functions
Spam IP Database and delete button

The Background and Reason for the SPAM IP Database and Delete I actually wrote up half of this article and was still testing the function and lost the whole post, which will teach me for adding it st..

12:24 pm, November 22, 2021
php functions
youtube search api request function

This function requests a search from the youtube search api, and searches the text in the snippet for the seearch string. You can get your own API key for this from the google developers console. They..

2:04 am, November 4, 2021
php functions
list all array json function list_all_array_json

I wrote this a while ago, and i always forget the complex functions i write so ill add it here.  This loads all fields and then returns them as json. 

5:51 am, November 3, 2021
php functions
php get file extension from a file name

this function returns the file extention, however if the file name has multiple . in it this will return a false value.

3:18 am, October 24, 2021
php functions
php post data back to a url with a function

this function uses curl to post back data to a url, this acts like a _POST form request from within a function. Function usage: $url the url to post the data back to e.g: $url = "https://kruxor.co..

3:11 am, October 24, 2021
php functions
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..

5:04 am, October 23, 2021
php
dont use md5 for password hashing using password_hash and password_verify

apparently md5 is not the best method for password hashing, you should use the php functions  password_hash(); and then  password_verify(); to verify the hash matches PHP password_hash..

5:09 am, April 7, 2021
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
therock Somewhere along this crazy road I learned (often times the hard way) the most important things I can do is be authentic, trust my gut, be the hardest worker in the room, celebrate the mistakes, be a grateful man and always remember that it's nice to be important, but it's more important to be nice.
The Rock
Random CSS Property

unicode-bidi

The unicode-bidi CSS property, together with the direction property, determines how bidirectional text in a document is handled. For example, if a block of content contains both left-to-right and right-to-left text, the user-agent uses a complex Unicode algorithm to decide how to display the text. The unicode-bidi property overrides this algorithm and allows the developer to control the text embedding.
unicode-bidi css reference