English 中文(简体)
如何产生元标签, 就像Facebook s linter 那样
原标题:how to generate meta tags just like facebook s linter does
  • 时间:2012-05-22 06:40:36
  •  标签:
  • php
  • facebook

我在做一个项目, 我必须向应用程序用户展示项目描述, 以及我拥有的是产品的尿素, 尿素可能来自任何网站, 它可能是来自Amazon,ebay等的产物尿素,

以下是我产品中的代码。 php我用来调试Facebook linter 。

<html>
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">
<meta property="fb:app_id" content="xxxxxxxxxxxxxx" /> 
<meta property="og:url" content="http://www.amazon.com/Programming-PHP-Rasmus-Lerdorf/dp/0596006810/ref=pd_sim_b_4" />
<meta property="og:site_name" content="social" />
<meta property="fb:profile_id" content="">
<meta property="og:type" content="website" />
<meta property="og:image" content="" />
<meta property="og:title" content="" />     
</head>
<body>
</body>
</html> 

When I pressed the debug button, it generates the meta tags as shown below enter image description here

我要显示与Facebook linter 生成的输出完全相同的输出, 以显示产品图像, 描述给我的用户 。

提前感谢

问题回答

如果我能正确理解你的问题...

您的站点元标记 :

<meta name="custom_image_tag" content="http://yoursite.com/images/product_1.jpg" />
<meta name="custom_description_tag" content="The product description" />

获取标签的 Php 代码

$tags = get_meta_tags( http://www.yoursite.com/some-page.html );

echo $tags[ custom_image_tag ];
echo $tags[ custom_description_tag ];

至于亚马逊,你可以使用他们的标题 元标签和废版图像 从页面。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签