Getscriptfile() Without The File?

Hello everyone,

Basically I just need to get the directory without the name at end of file.

Right now, the getScriptFile(); gives me:

/home/user1/public_html/website/index.php

However, I just want:.

/home/user1/public_html/website/

When I put a ‘../’, it shows up as this:

/home/user1/public_html/website/index.php/../dir

How come it doesn’t follow the normal conditions where it would go back a directory?

Dear Friend

It can be done in the following way.




dirname(Yii::app()->request->getScriptFile());



Regards

Ahh great I appreciate it thank youu!