[PHP]代码
function getcentreimg($src_ore,$src_thumb,$width,$height){
$img = getimagesize($src_ore);//载入图片的函数 得到图片的信息
switch($img[2]){//判断图片的类型
case 1:
$im=@imagecreatefromgif($src_ore);//载入图片,创建新图片
break;
case 2:
$im=@imagecreatefromjpeg($src_ore);
break;
case 3:
$im=@imagecreatefrompng($src_ore);
break;
}
$width_y=$img[0];
$height_y=$img[1];
if($width_y>$height_y){//如果宽大于高
$width_y_y=$height_y;
$height_y_y=$height_y;
$jq_x=($width_y-$height_y)/2;
$jq_y=0;
}else if($width_y<p> </p><p></p><div class="aritcle_card flexRow artxards">
<div class="artcardd flexRow">
<a class="aritcle_card_img" rel="nofollow" href="/xiazai/skill13222" title="Build MCP servers and clients for PHP applications with the official PHP SDK"><img
src="https://img.php.cn/upload/skill/001/246/273/6adaf20e352aa140.jpg" alt="Build MCP servers and clients for PHP applications with the official PHP SDK" onerror="this.onerror='';this.src='/static/lhimages/moren/morentu.png'" ></a>
<div class="aritcle_card_info flexColumn">
<a rel="nofollow" href="/xiazai/skill13222" title="Build MCP servers and clients for PHP applications with the official PHP SDK" class="overflowclass">Build MCP servers and clients for PHP applications with the official PHP SDK</a>
<p class="overflowclass">使用官方Model Context Protocol PHP SDK将PHP应用程序功能暴露为MCP工具、资源和提示,用于代理工作流。</p>
</div>
<a rel="nofollow" href="/xiazai/skill13222" title="Build MCP servers and clients for PHP applications with the official PHP SDK" class="aritcle_card_btn flexRow flexcenter"><b></b><span>下载</span>
</a>
</div>
</div><p> </p>