this is my first post. I already some days I tried but did not succeed.
Case: I want remove some of the words in the link from this link "http://www.amazon.com/Mindfulness-Be-mindful-Live-moment/dp/0857084445/ref=sr_1_1?s=books&ie=UTF8&qid=1443534574&sr=1-1&keywords=Mindfulness+Be+Mindful+Live+In+The+Moment"
this is my code
<?php
$s = 'http://www.amazon.com/Mindfulness-Be-mindful-Live-moment/dp/0857084445/ref=sr_1_1?s=books&ie=UTF8&qid=1443534574&sr=1-1&keywords=Mindfulness+Be+Mindful+Live+In+The+Moment';
preg_match("/http:/(.*)//", $s, $results);
echo $results[0];
?>
No for substr function cause the link is dynamic. I want keep "0857084445" using php regex. Your solution really helped me. Thank you
http://www.amazon.com/Mindfulness-Be-mindful-Live-moment/dp/0857084445/or only0857084445?http://www.amazon.com/Mindfulness-Be-mindful-Live-moment/dp/