I have a string of text that is the name of a file, and I want to show it only if the name of the file does not contain an image extension.
This are the string structures:
this-file-1.jpg
other_file.pdf
and-yet_another--file.zip
and-another-one.png
I've tried:
if ( strpos($value, 'jpg') === FALSE) {
echo $mostrarArchivos;
}
And it does work, but when I try this it doesn't:
if ( strpos($value, 'jpg') === FALSE ||
strpos($value, 'jpeg') === FALSE ||
strpos($value, 'png') === FALSE ||
strpos($value, 'gif') === FALSE
) {
echo $mostrarArchivos;
}
In the sense that it does show the string with the filename, even if the string says whatever.jpg
I do realizse that this should be done differently, so any suggestion is more than welcome.