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
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 sharing. I see the novelty of your writing, I will share it for everyone to read together. I look forward to reading many articles from you geometry dash
ReplyDeleteThanks for this useful info
ReplyDeletesee here
Needed to compose one little word yet thanks for the suggestions that you are contributed here...
ReplyDeleteBest Online Software Training Institute | RPA Training
Very useful article. I have understood many applications of hot mail
ReplyDeletehotmail.com sign in
cara menggugurkan hamil kandungan dengan cepat dan akurat terbukti ampuh untuk melunturkan janin kehamilan muda 1 minggu hingga 1 , 2 , 3 dan 4 bulan
ReplyDeleteobat penggugur kandungan adalah suatu bentuk proses berakhirnya kehamilan dengan dikeluarkannya janin ( fetus ) atau embrio sebelum memiliki kemampuan untuk berkembang dan bertahan hidup diluar rahim , sehingga bisa menyebabkan kematiannya pada janin
Disini akan kami beritahukan kepada Anda langkah cara cepat menggugurkan kandungan dengan cepat dan selamat adalah KURET dan obat aborsi
Kunyit memang tidak di baik di konsumsi oleh ibu hamil yang sedang hamil muda sehubungan dengan sifatnya untuk melancarkan haid , dan di percayai sebagai obat telat datang bulan
jual obat aborsi paling manjur Misiprostol Cytotec asli terbukti ampuh melunturkan janin kuat tanpa kuret dengan bersih untuk usia 1 , 2 , 3 sampai 4 bulan dengan aman
Thanks for the command of this topic, thanks to that I got here. Cool thing.
ReplyDeleteTamara
Very Useful article Thanks for sharing
ReplyDeleteRPA Training in Hyderabad
Really great work. Your article was very helpful.Thanks for sharing valuable points.Keep sharing.Thank You
ReplyDeleterpa training in chennai | rpa training in velachery | trending technologies list 2018
Thanks for such a nice article on Blueprism.Amazing information of Blueprism you have . Keep sharing and updating this wonderful blog on Blueprism
ReplyDeleteThanks and regards,
blue prism training in chennai
blue prism training institute in chennai
Blueprism certification in chennai
Supreet Solutions is the Best RPA Online Training Institute in Hyderabad which offers RPA Online Training by 15+ years of industry experts. From our training, you can acquire working knowledge skills on various Robotics Tools like Automation Anywhere, Blue Prism, UI Path. We Provide Best RPA Online Training With Live Practicals.
ReplyDeleteBest, Live RPA Online Training In USA,Hyderabad | Online RPA Training In USA, Hyderabad
Click Here Best RPA Online Training to go to RPA Online Training Institute Details.
Best RPA Online Training Institute In Hyderabad, RPA Online Training Institute In Hyderabad, Best RPA Online Training In Hyderabad, RPA Course In Hyderabad, RPA Training, RPA Training In Hyderabad, RPA Online Training In Hyderabad, Blue Prism Training In Hyderabad, Automation Training In Hyderabad, Blue Prism Online Training In Hyderabad, Automation Online Training In Hyderabad, Automation Course In Hyderabad, Automation Online Course In Hyderabad, Automation Training Institutes In Hyderabad, Automation Online Training Institutes In Hyderabad, RPA Course, Automation Course, Automation Training, RPA Course Fee In Hyderabad, RPA Training In Hyderabad Ameerpet, Best RPA Training Institutes In Hyderabad, RPA Training In Ameerpet, RPA Online Training Institutes In Hyderabad.
ReplyDeleteBest, Live RPA Online Training In USA,Hyderabad | Online RPA Training In USA, Hyderabad
Click Here Best RPA Online Training to go to RPA Online Training Institute Details.
Needed to compose one little word yet thanks for the suggestions that you are contributed here...
ReplyDeletePython Training in Chennai
Fiz uma next to have access to, you can access your email, you can review the email using the system, then click here to confirm the last 4 to do it In the last part of you in the last part of it 83 brain da certo oque eu faço.
ReplyDeletedelete hotmail account
RPA Training in hyderabad is offered by Digital Nest, Which Specialises in training RPA courses on RPA tools Like Blue Prism Training, ui path training, Automation anywhere .
ReplyDeleteRPA training is offered by real time industry experts in hyderabad by Experts from Tech Mahindra, Infosys, Delioitte. who has 10+ years of experience in dealing with various Tools and techniques specially in automations.
RPA training in hyderabad is in demand as many students and working professionals from various background are looking forward to the best courses that can help them in switching their jobs and also help the freshers grabbing jobs
https://www.digitalnest.in/rpa-training-in-hyderabad/
Delete
ReplyDeleteGreetings. I know this is somewhat off-topic, but I was wondering if you knew where I could get a captcha plugin for my comment form? I’m using the same blog platform like yours, and I’m having difficulty finding one? Thanks a lot.
Advanced AWS Online Training | Advanced Online AWS Certification Course - Gangboard
Best AWS Training in Chennai | Amazon Web Services Training Institute in Chennai Velachery, Tambaram, OMR
Advanced AWS Training in Bangalore |Best AWS Training Institute in Bangalore BTMLA ,Marathahalli
Thank you for sharing such great information with us. I really appreciate everything that you’ve done here and am glad to know that you really care about the world that we live in
ReplyDeletepython training Course in chennai
python training in Bangalore
Python training institute in bangalore
Fantastic work! This is the type of information that should follow collective approximately the web. Embarrassment captivating position Google for not positioning this transmit higher! Enlarge taking place greater than and visit my web situate
ReplyDeleteJava training in Pune
Java interview questions and answers
Java training in Chennai | Java training institute in Chennai | Java course in Chennai
Java training in Bangalore | Java training institute in Bangalore | Java course in Bangalore
Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
ReplyDeletebest rpa training in chennai
rpa training in chennai
rpa interview questions and answers
automation anywhere interview questions and answers
blueprism interview questions and answers
uipath interview questions and answers
rpa training in bangalore
This is a nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.
ReplyDeleteBest Devops online Training
Online DevOps Certification Course - Gangboard
All the points you described so beautiful. Every time i read your i blog and i am so surprised that how you can write so well.
ReplyDeleteData Science course in Chennai | Best Data Science course in Chennai
Data science course in bangalore | Best Data Science course in Bangalore
Data science course in pune | Data Science Course institute in Pune
Data science online course | Online Data Science certification course-Gangboard
Data Science Interview questions and answers
Data Science Tutorial
I simply couldn't leave your site just my reading this blog. I am really impressed with the content and way of writing. Keep sharing more.
ReplyDeleteSpoken English Classes in Chennai
Spoken English Classes in Bangalore
English Speaking Classes in Mumbai
Spoken English Classes in Coimbatore
Spoken English Classes in JP Nagar
English Speaking Classes in Mulund
IELTS Classes in Chennai
Very nice blog, Thank you for providing good information.
ReplyDeleteAir hostess training in Chennai
Air Hostess Training Institute in chennai
air hostess course fees structure in chennai
air hostess training academy in chennai
best article with nice information thank you
ReplyDeleteDevOps Training in Hyderabad
Salesforce Training in Hyderabad
SAP ABAP Online Training
SEO Training in Hyderabad
very nice blog rpa training in hyderabad
ReplyDeleteAll information is reliable for new readers. Keep it up.
ReplyDeleteData Science Training in Hyderabad
AWS Training in Hyderabad
RPA Training in Hyderabad
Big Data Training in Hyderabad
Hadoop Training in Hyderabad
Devops Training in Hyderabad
Great Article. Thanks for sharing info.
ReplyDeleteDigital Marketing Course in Hyderabad
Digital Marketing Training in Hyderabad
AWS Training in Hyderabad
Workday Training in Hyderabad
Whoa! I’m enjoying the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability and visual appeal. I must say you’ve done a very good job with this.
ReplyDeleteaws training in bangalore
RPA Training in bangalore
Python Training in bangalore
Selenium Training in bangalore
Hadoop Training in bangalore