How to print home page name if homepage and single on single?

I am creating a web page where I want to manipulate this style.

How to print home page name if requested page is index.php and Single Page Title on request of single.php ?

I am doing this,

function is_home() {
$requested_url = $_SERVER['REQUEST_URI'];
if($requested_url == '/index.php')

and calling this to print on home page, but nothing happens. Am i missing something? And how to do this?

if ( is_home() ) { echo 'Home Page';}

Why not echo $requested_url and see what it contains?

Depending on how a user gets to your home page and whether you’re rewriting URI’s, REQUEST_URI might differ. For instance, if they only typed something like ‘’ into their browser, the REQUEST_URI might simply be ‘/’. As Rubble suggested, you could print out $requested_url, see what you get and include it in your function, or you could use $_SERVER[‘PHP_SELF’], which gives you the path and filename of the script being executed.