Using wildcard * in php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • energy2080
    New Member
    • Jun 2007
    • 1

    #1

    Using wildcard * in php

    I am trying to create a link to a jpg file on my php website using a wildcard to return the string to the browser. Here is the function

    [code=php]
    function getUserProfile( $userid) {
    if ($userid == SPY_USERID) return NULL;

    return('../images/comprofiler/' . $userid . '*' . ".jpg");
    [/code]

    [Please use CODE tags when posting source code. Thanks! --pbmods]

    This returns http://mysite.com/images/comprofiler/63*.jpg

    it should return http://mysite.com/images/comprofiler...josfsfj234.jpg

    63 is the userid.

    Someone please show me the proper sytax for wilcards. Thanks
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Where does the text between '63' and '.jpg' come from?
    You can't just throw in a wild card sign and expect the code to guess the file name :P

    Comment

    Working...