dqluw20882 2014-08-20 14:11
浏览 8

我想要标题=文件名

I am using a plugin called inpost galleries and it uses stackoverflow. I want to force the title that appears below the image to be the name of the image rather than a title I have given it. Please see the site below if you have any suggestions.

I saw this code in a similar post but couldn't figure out how to use it.

<?=basename($image->filename, '.jpg')?>

If you have any suggestions, please let me know. Really new to jquery and php files. I know a little html, but all the $ and -> and echo's are really confusing to me.

Thanks in advance.

Oh yea, here is the link to the website, its a personal blog.

http://www.kiwiapples.com/maldives/

  • 写回答

1条回答 默认 最新

  • duanhuang2804 2014-08-20 15:00
    关注

    The code is PHP, not HTML. <?= ?> means "echo the result" or "output the result to the page", the -> means that filename is a property of the object $image. The $ denotes a variable in PHP.

    You can use:

    $path_parts = pathinfo('$image->filename');
    $title = path_parts['filename'];
    
    评论

报告相同问题?

悬赏问题

  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助
  • ¥15 STM32控制MAX7219问题求解答