Robert1995 22 Light Poster

Go ahead and try this :

    /**
     * @static
     * @param $filename
     * @param bool $comma
     * @return bool|string
     */
    public static function getFileExtension($filename, $comma = false) {
      if (strrpos($filename, '.')){
        $extension = substr($filename, strrpos($filename, '.'));

        return $comma ? $extension : substr($extension, 1);
      } else
         return false;

   }

Also, make sure you use this only on upload

Robert1995 22 Light Poster

even wondering why people use - rep .. I even explained this guy how to do it , but why only me .. The other 2 people told him 2..

mrnutty commented: Here have some if it makes you feel better. +5
Robert1995 22 Light Poster

To be able to do this you have to study 2 simple things :
1.Read this site http://www.cplusplus.com/doc/tutorial/classes/
Okay after you done that try understand what this program does ( it's not your homework , just random program to show classes)

/*
Assigment : using classes make a program to calculate gcd (Greatest_common_divisor)
*/

#include <iostream>

using namespace std;

int a,b;

int Show(int b){
    // showing the answer
    cout<<"Answer : "<<b;
}

int Calculate(int a,int b){
   // I am going to calculate the gcd
    int r;
     for(r=a%b; r; a=b, b=r, r=a%b);
  Show(b);
}

void Read(){
     //reading numbers
     cout<<"Enter Numbers ";
     cin>>a>>b;
     Calculate(a,b);
}

int main(){
    //Making It Happen;
    Read();
}

Part 2 ;
Searching in string ;

What is a string ?

String objects are a special type of container, specifically designed to operate with sequences of characters.
Unlike traditional c-strings, which are mere sequences of characters in a memory array, C++ string objects belong to a class with many built-in features to operate with strings in a more intuitive way and with some additional useful features common to C++ containers.

More Info at http://www.cplusplus.com/reference/string/string/
How to search in a string ?
Read this :
http://www.cplusplus.com/reference/string/string/find/

Hope this helped .. I kinda did your homework .:-/ . Hope didn't do something wrong again

jephthah commented: we don't do slacker's homework -1
Sodabread commented: To help fix Jeph's booboo =) +1
Salem commented: To help fix Jeph's booboo =) +20
Robert1995 22 Light Poster

damn . i am sorry won't happen again