dexter dexter - 2 months ago 6
PHP Question

how to change link from image url using php

i want to get image from google plus, url image like here

https://lh3.googleusercontent.com/-Sjhjjjjjj/........./s200-c/201gjghjphotoo1.jpg


how to can replace
s200-c
to
s0
for full size

my code but not work

$file = preg_replace("/.+\\/\\/(\\d+).+/", "s0", $file);

Answer

The PHP str_replace function can do the trick.

$file = str_replace("s200-c", "s0", $file);