str_replace

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Replace all occurrences of the search string with the replacement string
<?php str_replace(    array|string $search,    array|string $replace,    string|array $subject,    int &$count = null): string|array
<?php         $domain = $request->root();

        $fullUrl = $request->fullUrl();



        $key = str_replace($domain, '', $fullUrl);



        return $this->normalizeKey($key);

    }
<?php                 return preg_match('/(.*)\.(type)/', $key) && $value === 'image';

            })

            ->mapWithKeys(function ($value, $key) use ($bardPayload) {

                $key = str_replace('.type', '.attrs.src', $key);



                return [$key => Arr::get($bardPayload, $key)];

            })
<?php                 return preg_match('/(.*)\.(type)/', $key) && $value === 'link';

            })

            ->mapWithKeys(function ($value, $key) use ($bardPayload) {

                $key = str_replace('.type', '.attrs.href', $key);



                return [$key => Arr::get($bardPayload, $key)];

            })
<?php         }



        return $permission->label(

            __('statamic::permissions.'.str_replace(' ', '_', $permission->value()))

        )->description(

            __('statamic::permissions.'.str_replace(' ', '_', $permission->value().'_desc'))

        );
<?php         return $permission->label(

            __('statamic::permissions.'.str_replace(' ', '_', $permission->value()))

        )->description(

            __('statamic::permissions.'.str_replace(' ', '_', $permission->value().'_desc'))

        );

    }
<?php             return $this;

        }



        return str_replace('{'.$this->placeholder.'}', $this->placeholderValue, $this->value);

    }



    public function originalValue()
<?php             return $this;

        }



        $label = $this->label ?? str_replace('{'.$this->placeholder.'}', ':'.$this->placeholder, $this->value);



        return __($label, [$this->placeholder => $this->placeholderLabel]);

    }
<?php         $contents = File::get($from);



        if (config('statamic.users.tables.users', 'users') === 'users') {

            $contents = str_replace('USERS_TABLE_REPLACE', File::get(__DIR__.'/stubs/auth/update_users_table.php.stub'), $contents);

        } else {

            $contents = str_replace('USERS_TABLE_REPLACE', File::get(__DIR__.'/stubs/auth/create_users_table.php.stub'), $contents);

        }
<?php         if (config('statamic.users.tables.users', 'users') === 'users') {

            $contents = str_replace('USERS_TABLE_REPLACE', File::get(__DIR__.'/stubs/auth/update_users_table.php.stub'), $contents);

        } else {

            $contents = str_replace('USERS_TABLE_REPLACE', File::get(__DIR__.'/stubs/auth/create_users_table.php.stub'), $contents);

        }



        $contents = str_replace('USERS_TABLE', config('statamic.users.tables.users', 'users'), $contents);
<?php             $contents = str_replace('USERS_TABLE_REPLACE', File::get(__DIR__.'/stubs/auth/create_users_table.php.stub'), $contents);

        }



        $contents = str_replace('USERS_TABLE', config('statamic.users.tables.users', 'users'), $contents);

        $contents = str_replace('ROLE_USER_TABLE', config('statamic.users.tables.role_user', 'role_user'), $contents);

        $contents = str_replace('GROUP_USER_TABLE', config('statamic.users.tables.group_user', 'group_user'), $contents);
<?php         }



        $contents = str_replace('USERS_TABLE', config('statamic.users.tables.users', 'users'), $contents);

        $contents = str_replace('ROLE_USER_TABLE', config('statamic.users.tables.role_user', 'role_user'), $contents);

        $contents = str_replace('GROUP_USER_TABLE', config('statamic.users.tables.group_user', 'group_user'), $contents);



        File::put($to, $contents);
<?php         $contents = str_replace('USERS_TABLE', config('statamic.users.tables.users', 'users'), $contents);

        $contents = str_replace('ROLE_USER_TABLE', config('statamic.users.tables.role_user', 'role_user'), $contents);

        $contents = str_replace('GROUP_USER_TABLE', config('statamic.users.tables.group_user', 'group_user'), $contents);



        File::put($to, $contents);
<?php             $basePath = $this->getAddonPath($addon).'/src';

        }



        $path = $basePath.'/'.str_replace('\\', '/', $name).'.php';



        return $path;

    }
<?php     protected function getRelativePath($path)

    {

        return str_replace(base_path().'/', '', $path);

    }
<?php         }



        $file = Antlers::parse($this->files->get($this->getStub($stub)), $data);

        $file = str_replace('&lt;?php', '<?php', $file); // because we don't touch the parser on pain of death.



        $this->makeDirectory($path);