doushi3189 2015-06-26 20:59
浏览 25
已采纳

PHP - 将输出的CMS内容输入到php变量中

I use Perch for CMS, and in order to output content, you put the following code in your page:

<?php perch_content('Phone Number'); ?>

However, I need to make the outputted content into a php variable, something like:

$phonenumber = perch_content('Phone Number');

I'm a complete php novice and I've tried a few things but nothing is working.

Any ideas?

  • 写回答

2条回答 默认 最新

  • dongque1462 2015-06-26 21:01
    关注
    $phonenumber = perch_content('Phone Number', true);
    

    see http://docs.grabaperch.com/docs/content/perch-content/

    It's always a good idea to look into documentations ;)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
  • dtlrp119999 2017-05-21 13:31
    关注

    For specific content I had to use:

    perch_content('Events', array(
      'page' => '/sites/events.php',
      'skip-template' => true
      ));
    
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 用keil调试程序保证结果进行led相关闪烁
  • ¥15 paddle训练自己的数据loss降不下去
  • ¥20 用matlab的pdetool解决以下三个问题
  • ¥15 一道python的homework题,老是非零返回求解
  • ¥15 单个福来轮的平衡与侧向滑动是如何做到的?
  • ¥15 嵌入式Linux固件,能直接告诉我crc32校验的区域在哪不,内核的校验我已经找到了,uboot没有
  • ¥20 h3c静态路要求有详细过程
  • ¥15 调制识别中输入为时频图,星座图,眼图等
  • ¥15 数据结构C++的循环、随机数问题
  • ¥15 用sendmessage函数把第三方软件窗体隐藏 会什么再次运行第三方软件时 无法再隐藏了