hash1 Posted January 26, 2010 Share Posted January 26, 2010 What im trying to do is make this into an if else statement so that if the "URL" is equal to the "http://www.someurl.com/" below then it echos the array like it already does. I want the else statement to just echo something like the file_get_contents array but minus the $category and $slug variables and also to have the url be dynamic so the original url can be any and not just a "set" url. Or just have the below array be able to have any link instead of the set one. I hope im explaining this right if not I apologize and can go into further detail. <?php $post_id = get_post($post->ID); // get current post or page $slug = $post_id->post_name; // define slug as $slug $category = get_the_category($cat_name); echo file_get_contents('http://www.someurl.com/' . $category . '/watch-' . $slug . '.html?share=embed'); ?> Is there a way to do this? I've been stuck on this for awhile now, any help is greatly appreciated! Thanks Link to comment https://forums.phpfreaks.com/topic/189803-add-a-if-else-option-and-dynamic-url-option/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.