开发者

How to concatenate two arrays value into an other one

I use Fullcalandar and i need concatenate two array into $eventsArray['title']

I need to do som开发者_运维技巧ething like that for title ( this method don't work...)

$eventsArray['title'] = $items['subject'] + $items['eventname'];

My code

foreach ($eventgroup as $items){

  $eventsArray['title'] =  $items['eventname'];
  $eventsArray['start'] =  $items['date'];
  $eventsArray['weekends'] =  'false';
  $events[] = $eventsArray;
}

How can I do this please ? Thx


....
$eventsArray['title'] =  $items['subject']. ' ' .$items['eventname'];
...

Read this Manual


To concatenate use the dot

 $eventsArray['title'] = $items['subject'].$items['eventname'];


Slightly more readable method:

$eventsArray['title'] = "$items[subject] $items[eventname]";
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜