S
S
Sergey Defactov2018-03-13 06:27:51
PHP
Sergey Defactov, 2018-03-13 06:27:51

Correctly trim characters via str_replace?

there is a function that displays profile images, etc., there are symbols in the database in the form
%w , how can I insert the replacement of %w with 200 (size path) into this function

function Wo_GetMedia($media) {
    global $wo;


    if (empty($media)) {
        return '';
    }
    if ($wo['config']['amazone_s3'] == 1) {
        if (empty($wo['config']['amazone_s3_key']) || empty($wo['config']['amazone_s3_s_key']) || empty($wo['config']['region']) || empty($wo['config']['bucket_name'])) {
            return $wo['config']['site_url'] . '/' . $media;
        }
        return $wo['config']['s3_site_url'] . '/' . $media;
    }
    return  $wo['config']['site_url'] . '/' . $media;
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question