Skip to content

Conversation

GaneshKandu
Copy link

str_replace — Replace all occurrences of the search string with the replacement string

My http root directory is /home/usr/public_html/
public folder is /home/usr/public_html/public

str_replace replacing /public from and making it like /home/usr_html which is wrong.

$httpRootDir = substr($publicDir,0,-strlen($basePath));

This solution is working for me

> str_replace — Replace all occurrences of the search string with the replacement string

My http root directory is ```/home/usr/public_html/```
public folder is ```/home/usr/public_html/public```

str_replace replacing ```/public``` from and making it like ```/home/usr_html``` which is wrong.

```php
$httpRootDir = substr($publicDir,0,-strlen($basePath));
```

This solution is working for me
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant