<input type="hidden" name="com_link" value="?dir=<?php echo 'gallery/'.urldecode($curr_image['dir']); ?>&pic=<?php echo substr(urldecode($curr_image['filename']), 0, -4); ?>">
substr(urldecode($curr_image['filename']), 0, -4); I want to send filename without .jpg
There are a few methods you could use to get the path without the extension.
One would be to use PHP’s
substr()withstrrpos():This will get a substring of the
$imageup to the last..Another method, if you know that the extension will always be 4-characters long (including the
.), is to just chop off the last 4 characters:This last method appears to be what you were trying to do to begin with.