I created a website where users can post their page on Facebook, and I naturally encoded it, assuming they set the vanity URL for their page. For instance.
http://www.facebook.com/ myfacebookpage
But I forgot that some pages might have URLs like
http://www.facebook.com/pages/myfacebookpage/ 54878424154545487
My question is how to use PHP to capture part of the URL in bold ?
Thanks!
like this:
$url='http://www.facebook.com/pages/myfacebookpage/54878424154545487'; // the input $pieces = explode('/', $url); // divides the string in pieces where '/' is found $key=end($pieces); //takes the last piece
You can simply transcode the application to use https://graph.facebook.com/?ids=
https://graph.facebook.com/?ids=
Which will take both
Examples
Source: https://habr.com/ru/post/1484048/More articles:Emacs and Git show wrong time on Windows - gitMocking pimongo in a bulb - pythonObject.create (proto, propertiesObject) polyfill for IE support - javascriptPHP - remove duplicate syllable word - stringWHERE to check if an NVARCHAR record starts with a number or character in SQL - sqlWhy does C ++ not define INT_MIN as (1 << 31) - c ++Coda2 and Git: Git work, but there is no comparison, click or drag - gitRails Devise + Devise-bascamper How to allow superuser to log into any account? - ruby | fooobar.comManaging Entity Framework Connectivity from Streams - .netTiming errors in our game, currentTimeMillis freezing? - androidAll Articles