OG (Open Graph) meta tag is designed by Facebook to make url share easy on social networking websites. Now days these tags are widely used by other websites. If you are running a social networking website or planning to run one. You can make url sharing easy by fetching these tags.
Today I will show you how we can get/fetch OG meta tags with PHP script.
fetch_og PHP function
/** * Fetch OG Metatags * @param string $url * * @return array */ function fetch_og($url) { $data = file_get_contents($url); $dom = new DomDocument; @$dom->loadHTML($data); $xpath = new DOMXPath($dom); # query metatags with og prefix $metas = $xpath->query('//*/meta[starts-with(@property, \'og:\')]'); $og = array(); foreach($metas as $meta){ # get property name without og: prefix $property = str_replace('og:', '', $meta->getAttribute('property')); # get content $content = $meta->getAttribute('content'); $og[$property] = $content; } return $og; }
Usages
$og = fetch_og('http://www.w3bees.com'); echo $og['title'];
Thanks :) This really helped!
ReplyDelete
DeleteHai ma thú cấp tám bên trong đều là ma thú cấp tám sơ kỳ.
Hắc Ám Thần Điện lần này xuất ra tổng cộng là bảy con ma thú hắc ám, bây giờ chỉ còn lại ba con, nhưng ba con chỉ là ma thú cấp tám sơ kỳ.
Cự Viên Tộc ma thú đối với ma thú của Hắc Ám Thần Điện phát khởi công kích, Nhạc Thuần và Nhạc Sử Chân cũng đều chọn một hán tử áo đen mà tấn công.
Loại thực lực đối kháng này hoàn toàn kém xa, Nhạc Sử Chân và Nhạc Thuần hai người cũng chỉ có tu vi thất tinh Đấu Tôn, cộng them với đấu kỹ cao thâm của Nhạc gia, khiến cho hán tử áo đen bị trọng thương.
Kỳ thật bốn hán tử áo đen này lúc đầu đã muốn chạy trốn nhưng không thể nào thoát ra hkoir.
Bọn họ khôdongtam
mu moi ra hom nay
tim phong tro
http://nhatroso.com/
nhạc sàn
tổng đài tư vấn luật
văn phòng luật hà nội
tổng đài tư vấn luật
thành lập công ty trọn gói
http://we-cooking.com/
chém gió
trung tâm tiếng anhng có cơ hội trốn mà thôi, nếu như thật sự chạy thoát thì cũng bị nhốt trong cấm chế của Nhạc Thành.
Lúc này, Tiểu Song ở phía xa xa không làm gì, hai người tự động lùi ra ngoài, miễn cho mọi người bị vưỡng chân vướng tay.
Hỏa diễm công kích của Địa Ma Lão Nhân không lâu đã trở nên tán loạn, nửa năm
IEEE Final Year projects Project Centers in India are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. IEEE Project Domains It gives you tips and rules that is progressively critical to consider while choosing any final year project point.
DeleteJavaScript Online Training in India
JavaScript Training in India
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
Hii I read your blog and found that your blog is full of informative content. So keep posting thanks for share this article.your article is very amazing.i like your article. thanks you ones again.
DeleteUNIRAJ BA 3RD YEAR RESULT 2020
UNIRAJ BSC 1ST YEAR RESULT 2020
RANCHI UNIVERSITY RESULT 2020
ALLAHABAD UNIVERSITY BA PART 3 RESULT
BA FINAL YEAR RESULT 2020
UU UNIVERSITY BA FINAL YEAR RESULT 2020
BSC RESULT 2020 (PART 1ST,2ND,3RD)
For some URLs I never get the correct response.
ReplyDeleteCan anyone please help me on this issue.
for any post from nytimes.com I always get null while fetching og.
ReplyDeletePlease help !
This blog is really informative. I gained more knowledge by reading your post. Thanks for providing us the useful information with us. Your blog is really helpful for me in attaining my knowledge in a right way.
ReplyDeleteCCNA Training in Chennai
Thank you for having taken your time to provide us with your valuable information relating to your stay with us.we are sincerely concerned.., Most importantly, you Keepit the major...
ReplyDeleteSEO Training in Chennai
Great Article I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because it becomes more and more interesting from the starting lines until the end. So Thank you for sharing a COOL Meaningful stuff with us Keep it up..!
ReplyDeleteSAP training in Chennai
I have read your blog its very attractive and impressive. I like it your blog.
ReplyDeletePHP Training in chennai | PHP Training Course
PHP Training in chennai | Online PHP Course
Tiếng anh cho người đi làm
ReplyDeleteTiếng anh cấp tốc
Luyện thi toeic tại hà nội
Tiếng anh cho người lớn tuổi
Tiếng anh cho người mới bắt đầu
Học tiếng anh tại hà nội
dạy tiếng anh cho doanh nghiệp
Rajasthan High Court Result
ReplyDeleteUP 12th Time Table
SSC CHSL Application Form
GATE Application Form
Rajasthan Board 12th Time Table
RPSC 1st Grade Teacher Syllabus
RPSC 2nd Grade Teacher Result 2017
SSC CGL Admit Card
SSVS Sansthan Recruitment 2017
ReplyDeleteSSVS Sansthan Recruitment
SSVS Sansthan Vacancy
SSVS Sansthan Job
Apply For MAHAGENCO LDC Recruitment here
ReplyDeleteClick here to Download EESL Assistant Engineer Admit Card
what if there are multiple og:images??
ReplyDeleteIts gets me the last one. I want to get the first og:image instead
Thanks for this wonderful post. The information in this article is very helpful to me. Thanks a lot for sharing. Keep blogging.
ReplyDeleteBest Truth or Dare Questions for Kids
Thanks for this wonderful post. The information in this article is very helpful to me. Thanks a lot for sharing. Keep blogging.
ReplyDeleteInterest Waypoint
RRB ALP Recruitment 2018
ReplyDeleteRRB Allahabad Recruitment 2018
RRB Ajmer Recruitment 2018
RRB Bangalore Recruitment 2018
RRB Ahmedabad Recruitment 2018
RRB Bhopal Recruitment 2018
RRB Bhubaneswer Recruitment 2018
You truly did more than visitors’ expectations. Thank you for rendering these helpful, trusted, edifying and also cool thoughts on the topic.
ReplyDeleteME/M.Tech Project Center in Chennai | ME/M.Tech Project Center in Velachery
JNVU Result 2018
ReplyDeleteBrij University Result 2018
RRBM University Result 2018
Kota University Result 2018
Uniraj Result 2018
Shekhawati University Result 2018
MLSU Result 2018
MDSU Result 2018
MGSU Result 2018
RTU Result 2018
Thanks for your great and helpful presentation I like your good service. I always appreciate your post. That is very interesting I love reading and I am always searching for informative information like this.Also Checkout: blockchain technology training chennai | blockchain training institute in chennai | blockchain training in chennai | cryptocurrency training in chennai
ReplyDelete
ReplyDeleteThank you so much for posting this. I really appreciate your work. Keep it up. Great work!Best Placement company in Hyderabad
Nice Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
ReplyDeleteCheck out : big data training in velachery
big data hadoop training cost in chennai
big data training in chennai omr
big data training in chennai velachery
Really useful information. Thank you so much for sharing.It will help everyone.Keep Post. RPA training in chennai | RPA training in Chennai with placement | UiPath training in Chennai | UiPath certification in Chennai with cost
ReplyDeleteGood job and thanks for sharing such a good blog You’re doing a great job. Keep it up !!
ReplyDeletePMP Certification Fees | Best PMP Training in Chennai |
pmp certification cost in chennai | PMP Certification Training Institutes in Velachery |
pmp certification courses and books | PMP Certification requirements |
PMP Training Centers in Chennai | PMP Certification Requirements | PMP Interview Questions and Answers
It’s interesting content and Great work. Definitely, it will be helpful for others. I would like to follow your blog. Keep post
ReplyDeleteCheck out:
best hadoop training in omr
hadoop training in sholinganallur
best institute for big data in chennai
big data hadoop course in chennai with placement
Very informative blog post! I would like to thank for the efforts you have made in writing this great article. Thanks for sharing.
ReplyDeleteData Science Courses in Bangalore
I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge. I truly adored reading your posting. Thank you!
ReplyDeletedate analytics certification training courses
data science courses training
data analytics certification courses in Bangalore
ExcelR Data science courses in Bangalore
Thumbs up guys your doing a really good job.
ReplyDeleteData Science Course in Pune
I just couldn't leave your website before telling you that I truly enjoyed the top quality info you present to your visitors? Will be back again frequently to check up on new posts.
ReplyDeleteAI learning course malaysia
ReplyDeleteGreat post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more.
https://www.w3bees.com/2013/11/fetch-facebook-og-meta-tags-with-php.html
Nice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here.
ReplyDeleteGreat Post
I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page! digital marketing course in singapore
ReplyDeleteThis is also a very good post which I really enjoyed reading. It is not every day that I have the possibility to see something like this,
ReplyDeleteData science Courses banglore
Kalau memang anda mau mendapatkan keuntungan yang lebih bagus, ini akan menjadikan kita benar-benar paham dengan beberapa penawaran yang asli dan bukan menipu
ReplyDeleteasikqq
pionpoker
dewaqq
bandar ceme
sumoqq
hobiqq
paito warna
interqq
forum prediksi
ReplyDeleteAmazing post, thanks for sharing this article. I am truly motivated by you for blogging.
Thank You.
One data science
One Machine Learning
With so many books and articles coming up to give gateway to make-money-online field and confusing reader even more on the actual way of earning money,
ReplyDeleteAI course malaysia
Thank you for making me aware of this news.
ReplyDeleteหางานราชการ
You are very good at that.
ReplyDeleteงานราชการ
Nice Post...I have learn some new information.thanks for sharing.
ReplyDeleteClick here for ExcelR Business Analytics Course
I am looking for and I love to post a comment that "The content of your post is awesome" Great work!
ReplyDeleteExcelR data analytics courses
This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.
ReplyDeleteExcelR data science course in mumbai
Very nice blog here and thanks for post it.. Keep blogging...
ReplyDeleteData Science Training in Hyderabad
thanks for sharing this useful with us...keep updating
ReplyDeleteData Science Training in Hyderabad
Great Article
ReplyDeleteData Mining Projects
Python Training in Chennai
Project Centers in Chennai
Python Training in Chennai
I just loved your article on the beginners guide to starting a blog.If somebody take this blog article seriously in their life, he/she can earn his living by doing blogging.thank you for thizs article. best blockchain online training
ReplyDeleteGood blog...way of delivering this blog is good..
ReplyDeleteAWS Training in Chennai
AWS Training in Bangalore
AWS Training in Coimbatore
AWS Training in Hyderabad
Data Science Courses in Bangalore
Devops Training in Bangalore
Best AWS Training in Marathahalli
AWS Institutes in Hyderabad
AWS Coaching Centers in Hyderabad
AWS Coaching in Hyderabad
This is a wonderful article, Given so much info in it, Thanks for sharing. CodeGnan offers courses in new technologies and makes sure students understand the flow of work from each and every perspective in a Real-Time environmen python training in vijayawada. , data scince training in vijayawada . , java training in vijayawada. ,
ReplyDeleteData Science Course Training in Bangalore is the best data science course
ReplyDeleteCheck here latest govt jobs rapidjobresult
ReplyDeleteRRB NTPC Online Application Form
Upcoming Govt Jobs
12th Pass Government Job
SSC CGL Online Application Form
Railway Recruitment
This Was An Amazing ! I Haven't Seen This Type of Blog Ever ! Thankyou For Sharing, data science courses
ReplyDeleteThis Was An Amazing ! I Haven't Seen This Type of Blog Ever ! Thankyou For Sharing, data sciecne course in hyderabad
ReplyDelete
ReplyDeleteI read your blog and i found it very interesting and useful blog for me. I hope you will post more like this, i am very thankful to you for these type of post.
Visit : https://pythontraining.dzone.co.in/training/data-science-training.html
Thank you.
wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries.
ReplyDeleteData science Interview Questions
ReplyDeleteVery interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspried me to read more. keep it up.
Correlation vs Covariance
It is truly an honour to run across informational content like the one you have written. You are evidently knowledgeable on this written topic and you have unique views to share.
ReplyDeleteSAP training in Kolkata
Best SAP training in Kolkata
SAP training institute in Kolkata
A great piece of writing! You have an efficient flair for high quality writing. I am highly impressed by your way of writing this content beyond words. I really have a lot of appreciation for your writing. Thank you so much for all your priceless input on this topic.
ReplyDeleteSAP training in Mumbai
Best SAP training in Mumbai
SAP training institute Mumbai
ReplyDeleteنحن شركة تنظيف مكيفات بالرياض متخصصة في تنفيذ اعمال تنظيف وصيانة واصلاح جميع انواع المكيفات التي تستخدم داخل المنازل والفلل والشركات والمصانع وكافة الاماكن حيث تقدم خدمات تنظيف مكيفات شباك ومكيفات صحراوية ومكيفات شباك ومكيفات سبيلت والتكيفات المركزية باستخدام الوسائل الحديثة ويتم تنظيف الوحدات الداخلية للمكيفات وازالة الاتربة والغبار والاوساخ وازالة الروائح الكريهة العالقة بالمكيف كما يقوم فني مكيفات بالرياض بصيانة واصلاح جودة التبريد وضبط صوت التكيف للمستوي المثالي وغيرها من أعمال الصيانة فقط عزيزي العميل قم بالتواصل معنا وقم بعرض مشكلتك وسوف تقوم افضل شركة تنظيف مكيفات بالرياض بسرعة التواصل معك والوصول إليك حيث ما كنت لعمل اللازم علي الفور فقط قم بالاتصال علي ارقامنا نصلك اين ما كنت علي الفور.
خدمات اخرى:-
شركة رش مبيدات بالرياض
Very interesting blog. Many blogs I see these days do not really provide anything that attracts others, but believe me the way you interact is literally awesome.You can also check my articles as well.
ReplyDeleteData Science In Banglore With Placements
Data Science Course In Bangalore
Data Science Training In Bangalore
Best Data Science Courses In Bangalore
Data Science Institute In Bangalore
Thank you..
Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteCorrelation vs Covariance
Simple linear regression
data science interview questions
ReplyDeleteGreat Article
Cloud Computing Projects
Networking Projects
Final Year Projects for CSE
JavaScript Training in Chennai
JavaScript Training in Chennai
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
I am looking for and I love to post a comment that "The content of your post is awesome" Great work!
ReplyDeleteSimple Linear Regression
Correlation vs Covariance
Attend The Data Analyst Course From ExcelR. Practical Data Analyst Course Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Analyst Course.
ReplyDeleteData Analyst Course
Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteCorrelation vs Covariance
Simple Linear Regression
data science interview questions
KNN Algorithm
Very good points you wrote here..Great stuff...I think you've made some truly interesting points.Keep up the good work.
ReplyDelete360digitmg
Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
ReplyDeleteblockchain online training
best blockchain online training
top blockchain online training
very well explained. I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteLogistic Regression explained
Correlation vs Covariance
Simple Linear Regression
data science interview questions
KNN Algorithm
Attend The Data Science Training Bangalore From ExcelR. Practical Data Science Training Bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Science Training Bangalore.
ReplyDeleteData Science Training Bangalore
Excellent Blog!!! Waiting for your new blog... thanks for sharing with us.
ReplyDeletesalesforce architect certification
interview techniques
career after bsc
tools used in data science
oracle interview questions and answers
Great article. I highly recommended you. Click here for data science course in Hyderabad.
ReplyDeleteI've read this post and if I could I desire to suggest you some interesting things or suggestions. Perhaps you could write next articles referring to this article. I want to read more things about it!
ReplyDeletedata science training
I recently came across your article and have been reading along. I want to express my admiration of your writing skill and ability to make readers read from the beginning to the end. I would like to read newer posts and to share my thoughts with you.
ReplyDeletedata science certification
Necessary to learn salesforce online
ReplyDeleteu
ReplyDeletegia ve may bay tu han quoc ve viet nam
vé máy bay hải phòng đi hồ chí minh
vé máy bay giá rẻ tphcm đi hà nội
vé máy bay khứ hồi nha trang
vé máy bay đi huế vietnam airlines
Fantastic blog extremely good well enjoyed with the incredible informative content which surely activates the learners to gain the enough knowledge. Which in turn makes the readers to explore themselves and involve deeply in to the subject. Wish you to dispatch the similar content successively in future as well.
ReplyDeleteData Science Training in Raipur
Very informative.
ReplyDeleteBest Bike Taxi Service in Hyderabad
Best Software Service in Hyderabad