Find characters in string
This will remove all non-integer characters, including commas and currency symbols. The output is a float.
time, array, calc
This snippet is useful for calculating the length of a playlist. 2 videos at 5 min 45secs each would give 11:30 total play time.
img, preg_replace, extract, source
For situations where an image is stored inside a WYSIWYG editor you cannot pass that directly an img tag instead you need to extract the source path inside the <img src=''> tags. This can be done by using this regular expression.
This snippet looks inside a $content variable and looks for all img tags and extracts the src path and created a new img tag from them. This allows classes to be added to images.
opendir, mkdir, readdir, is_dir, copy
This function is used to copy a folder and all its contents and sub folders, its params are as follows:
1) The source folder path
2) The destination path (should not exist)
file_get_contents, fileput_contents, str_replace
This function is used to rename all instances of a word in a file.
Pararms are as follows:
1) Path to the file
2) The name to rename
3) The new name to be used
This class deletes a directory along with its contents no matter how deep/nested its sub-directories are.
Forgot your password?
Don't have an account? Register
Copyright © 2011 - 2018 created by David Carr Web Developer. All code MIT license. All rights reserved. Built using Simple MVC Framework