Jump to content

using the glob function with a $ function


carlosx2

Recommended Posts

I had this all figured out and it worked too. I am using the get function to get a variable from the url, that will be used by glob function to scan a folder on the server and return an array that i will use for people to download movies. but because the variable i got from the url has several characters that are not corresponding with the folder on the server i came up with a simple way to filter them out and be left with a first and last name that would math with the first and last name and a space just like the folder name on my server. 

 

So i thought i had this all figured out on my own but then i saw that function that is holding the first and last name and space just i need it to be, isn't working when i put it in the glob function.

 

So my question is how do you add functions to a glob path.

 

Here is the code

$model = $_GET['id'];
$movie = glob("components/content/videos/downloads/$path/*.jpg");
$filename = (explode (":",$model));
$filename2 = (explode ("-",$filename[1]));
$space = " ";
$path = $filename2[0]. $space . $filename2[1];

 

this only part of the code. but it all happens in the part.

 

Who can tell me how to approach this?

Link to comment
Share on other sites

$model = $_GET['id'];
$movie = glob(functionToUse()."components/content/videos/downloads/$path/*.jpg");
$filename = explode(":",$model);
$filename2 = explode("-",$filename[1]);
$space = " ";
$path = $filename2[0]. $space . $filename2[1];

 

. is the concatenation operator you can use it in conjunction with functions aswell as variables.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.