PHP 數據庫操作

<span style="font-family: Arial, Helvetica, sans-serif;"><?php foreach ($all as $result){</span>
							$url = home_url()."/wp-content/themes/twentythirteen/pic/".$result['pic'];
							$headers = @get_headers($url);
							if(strpos($headers[0],'404') )
							{
								$url=home_url()."/wp-content/themes/twentythirteen/pic/default.png";
							}
							$content=$result['detail']."<br>";
							$detail = preg_replace('/<a.+?\/>/', '', $content);
							date_default_timezone_set('PRC'); // 中國時區
							$time=date('Y-m-d H:i:s',$result['time']);
							echo  "<li>
								<div class='program_img'>
									<a href='?page_id=222&program_id=".$result['id']."'>
										<img src='".$url."' width='150' height='180'>
									</a>
								</div>
								<div  class='program_text'>
									<a class='program_title' href='?page_id=222&program_id=".$result['id']."' title=' '>".$result['title']." </a>
									<span class='program_time'><b>時間:</b>".$time."<br><b>概要:</b>".mb_substr($detail,0,60,'utf-8')."……</span>
								</div>
								
							</li>";
						}?>


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章