Is it possible to fetch the whole URL?

Is it possible, to fetch the whole URL?

For example, I have a variable $thumbnail =

The link:

cdn1.image.website.webcdn.com/115600/20/4851311/original/8.jpg

Is there a way to fetch this so I can assign it to $thumbnail =

THANKS! :smiley:

depends on how you’re retrieving the image.

These 3 parts of the url is dynamic… they change depending on the image: 115600/20/4851311

So, ideally, I would like to do some kind of variable that changes when these change.

Then just take those variables and put them on $thumbnail, something like what’s below.

$thumbnail = “cdn1.image.website.webcdn.com/".$user."/”.$image;

Oh, I tried and I tried :o I can add one variable, but if I add two or three, it doesn’t fetch image :frowning: For the life of me I can’t figure out why.

This works:
[php]$thumbnail = ‘cdn1.image.website.webcdn.com/201305/25/’.$url_id.’/original/8.jpg’; [/php]

BUT if I try to add one or two of these variables to the path /20305/25/ it absolutely fails.

Here is what I am using… any suggestions?? Please.

[php]

<?php function _video_embed_website_split($s, $str) { $ret = array(); $tmp = ''; $size = strlen($str); for ($i = 0; $i < $size; $i++) { $char = d_substr($str, $i, 1); if ($char == $s) { $ret[] = $tmp; $tmp = ''; } else { $tmp .= $char; } } if ($tmp) { $ret[] = $tmp; } return $ret; } function _video_embed_website_get_video_id_url($url) { $matches = array(); $matches = _video_embed_website_split("/", $url); $index = count($matches) - 5; if ($matches[$index]) { return $matches[$index]; } return FALSE; } function _video_embed_website_get_video_url_name($url) { $matches = array(); $matches = _video_embed_website_split("/", $url); $index = count($matches) - 4; if ($matches[$index]) { return $matches[$index]; } return FALSE; } function _video_embed_website_get_video_url_id($url) { $matches = array(); $matches = _video_embed_website_split("/", $url); $index = count($matches) - 3; if ($matches[$index]) { return $matches[$index]; } return FALSE; } [/php]
Sponsor our Newsletter | Privacy Policy | Terms of Service