I managed to get the cover picture but i can't get the full size one. I've read on some other stackoverflow post that instead of getting it from facebook api they were replacing the url (what i'm doing now).
https://graph.facebook.com/me?fields=cover
A) At best i would like facebook to return the full size cover if it is possible, so i don't need to do the case B.
B) If case A is not possible, is it possible to change what i'm doing now to regex? I'm just not sure it is the best way to do if case A is not possible.
$total_chars = strlen($response->cover->source);
$last_occurence = strrpos($response->cover->source, '/');
$new_haystack = substr_replace($response->cover->source, '', $last_occurence, ($total_chars - $last_occurence));
$first_occurence = strrpos($new_haystack, '/');
$new_cover_url = substr_replace($response->cover->source, '', ($first_occurence + 1), ($last_occurence - $first_occurence));
since :
need to be :
(p180x540/ has been removed).
p180x540/
? If so astr_replace
should do the trick. – chris85pnumbersxnumbers/
or alwaysp3numbersx3numbers/
? or maybe not starting with ap
always as well? – chris85