dqdfpmmi022763 2014-07-21 09:31
浏览 42
已采纳

从产品描述中提取10个单词,进入页面$ title

i have 1500 products listed on the website. the page titles are all the same by default code below

$title="Detail Turkish Property For Sale in Turkey";

to make the page titles more descriptive about the products, i would like to get the first 10 words from the page product descriptions, to show in the page titles.

i have tried this example with no change,

$title = stripslashes(substr($emlaklist->aciklama,0,80));

your suggestions to solve this issue would be appreciated.

  • 写回答

4条回答 默认 最新

  • dongliangkeng1056 2014-08-24 12:46
    关注

    From what I see in the comments, you will first have to make sure that your variable ($emlaklist) is already set, when you want to append it's value to the $title variable.

    In general you might try to copy the code-part that starts with $emlaklist = .. to the place before your $title =, but most likely this will be a database request, so you might need to take other code into account, that contributes to getting that value ...

    Other than that, the other answers here will be very well able to handle the shortening of your description, etc.

    (Sry that this is too long for a comment, but it might be helpful anyway.)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?