Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //sometime string return this value
- $string = 'mydomain.com/wp-content/uploads/2015/01/name-file-300x215.jpg';
- //and sometime string return like this (original size)
- // $string = 'mydomain.com/wp-content/uploads/2015/01/name-file.jpg';
- //or sometime string return like this (external image link)
- // $string = 'otherdomain.com/wp-content/uploads/2015/01/name-file.jpg';
- //the point now, i want this newstring return like this
- // $string = 'mydomain.com/wp-content/uploads/2015/01/name-file-90x90.jpg';
- if(strpos($tring, 'mydomain.com/wp-content/uploads') !== false ){ //check if this string is internal image link
- // SO WHAT TO DO BELOW?
- $newstring = ''; // i want this $newstring return this value -> mydomain.com/wp-content/uploads/2015/01/name-file-90x90.jpg
- //so i can $newstring (new image size 90x90) if string return internal image link
- $return $newstring;
- } else {
- return $string;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement