如何更改ID的位置

时间:2014-07-27 08:51:47

标签: php location

来源:

else if ($key == 'title'){
    if (strlen($value->advObj['title']) > 15)
        $advTitle = substr ($value->advObj['title'], 0,15)."...";
    else
       $advTitle = $value->advObj['title'];
    echo '<a href="index.php?p=newApp&id=&obj=cpn'.$value->advObj['id'].'">'.$value->advObj['id'].' - '.$advTitle.'</a>';
}

点击结果:

index.php?p=newApp&id=&obj=cpn1038

我需要它:

index.php?p=newApp&id=1038&obj=cpn

我该怎么做

1 个答案:

答案 0 :(得分:1)

从中使用:

else if ($key == 'title')
{
    if (strlen($value->advObj['title']) > 15)

        $advTitle = substr ($value->advObj['title'], 0,15)."...";
    else

        $advTitle = $value->advObj['title'];

    echo '<a href="index.php?p=newApp&id='.$value->advObj['id'].'&obj=cpn">'.$advTitle.'</a>';
}