Skip to content
Advertisement

Tag: str-replace

How to remove multiple slashes in URI with ‘PREG’ [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 10 months ago. Improve this question I am using str_replace() for removing extra slashes from url i dont know how to redirect the url to new url if find multi slashes

STR_REPLACE to add prefix to mysql query in php

This is my query This is the function to add prefix to tables (This function is taken from MySqliDB class) When I echo rawAddPrefix($q,”demo_”) I get only prefix added to tbl_accounts table only. I need to add prefix to all tables. What’s wrong here ? Answer That function above does only point and make changes to one occurrence. I’d suggest

str_replace() is not working in aws server returning empty string but working on cpanel and locally

I am developing a laravel ride sharing applicaiton and for the settings data I used a config files. To change any value usign file file_get_contents after that with str_replace and file_put_contents for updating the value. here is some code example: But the $change_content doesn’t return any value in the AWS server NOTE: This is working in my local machine also

PHP How to add plus (+) character before double quotes and words without double quotes in string [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 6 years ago. Improve this question I have below string: And I want to add plus (+) character before

Replace multiple dashes with one dash

I have a string which looks like this: I want to replace the multiple dashes with a single one. So the expected output would be: I tried to use str_replace(), but I have to write the code again for every possible amount of dashes. So how can I replace any amount of dashes with a single one? For Rizier: Tried:

Advertisement