我不知道如果我可以正确解释自己,但我想获得标题但没有东西,例如:
标题是:“Recipie:Orange Juice”,我得到了这个
<?php the_title(); ?>
我想得到“橙汁” 有可能吗?
答案 0 :(得分:0)
你可以像这样用空字符串替换'Recipie:'
<?php
$title = get_the_title();
$title = str_replace( $title, 'Recipie:','');
echo $title;
?>
答案 1 :(得分:0)
正确的方法:
Vector<double> vectorArrayBuy = CreateVector.Dense(listMRInfoBuy.ElementAt(0).OutputBuy.ToArray());
var matrixArrayBuy = CreateMatrix.DenseOfColumnArrays(listMRInfoBuy.ElementAt(0).ListValuesBuy.ToArray(), listMRInfoBuy.ElementAt(1).ListValuesBuy.ToArray(), listMRInfoBuy.ElementAt(2).ListValuesBuy.ToArray(),
listMRInfoBuy.ElementAt(3).ListValuesBuy.ToArray(), listMRInfoBuy.ElementAt(4).ListValuesBuy.ToArray(), listMRInfoBuy.ElementAt(5).ListValuesBuy.ToArray(), listMRInfoBuy.ElementAt(6).ListValuesBuy.ToArray(),
listMRInfoBuy.ElementAt(7).ListValuesBuy.ToArray(), listMRInfoBuy.ElementAt(8).ListValuesBuy.ToArray(), listMRInfoBuy.ElementAt(9).ListValuesBuy.ToArray(), listMRInfoBuy.ElementAt(10).ListValuesBuy.ToArray(),
listMRInfoBuy.ElementAt(11).ListValuesBuy.ToArray());
var itemsBuy = MultipleRegression.NormalEquations(matrixArrayBuy, vectorArrayBuy);
答案 2 :(得分:0)
根据Jason Caldwell的答案,这里是the_clean_title
函数:
function the_clean_title($post_id = null) {
// get the title.
$title = get_the_title($post_id);
// replace leading prefix and colon if one exists.
$title = preg_replace('/^[^:]+\:\s*/', '', $title);
// output the title.
echo $title;
}
用法与the_title
功能相同,只需在源代码中用the_title
替换the_clean_title
来电:
the_clean_title();