hi, i am very very new to php.
have a some code like this
// Get file name from URL and remove any bad filename chars.
$url_parts = explode('/', $url);
$num = count($url_parts)-1;
$file_name = $url_parts[$num];
$badchararray = array(" ", "'", "\"", "$", "&", "%", "-", "#", "^", "*", "(", ")", "~", "@", "/", "?", "=");
$file_name = str_replace($badchararray, "", $file_name);
$file_name = stripslashes(strtolower($file_name));
if ($append_file_name == true && lentgh) {
$save_name = $id . '_' . $file_name;
}else {
$save_name = $file_name;
}
could you please tell me how or what can i do to add an if clause to say or anyother thing i can do, if the file name is longer then 40 chracters display to s user saying file name is too long please rename your file shorter and then upload again.
thank you