开发者

implode the array by AND in between

I have this

$myarr = Array(
    0 => "Person.id = PL.id AND AIG.id = PL.key,"
    1 => "start_date BETWEEN  '$startDate' AND  '$endDate'",
    2 => "J = 78349",   
    3 => "text is not null;"
)

I want to implode this array with an AND like

implode("AND", $myarr) 

But it doesnt but AND between the 4 elements of array. How would I put an AND between these 4 elements of the 开发者_StackOverflow社区array.


$string = implode(" AND ",$myarr);

that should work fine. It will write the output to $string.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜