D
D
Demon2015-09-25 11:00:57
PHP
Demon, 2015-09-25 11:00:57

How to fix syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'?

Help fix syntax error:
Browser gives:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'

Whole code:
if(preg_match("/http:\/\/vk.com|http:\/\/www.vk.com/i", $video_lnk)){
$rEXPVK = explode('<img id="player_thumb" src="', $html);
$rEXPVK_2 = explode('"', $rEXPVK[1]);
$rEXPVK_3 = explode('var video_title = \'', $html);
$rEXPVK_4 = explode("'", $rEXPVK_3[1]);
$rEXPVK_4[0] = urldecode($rEXPVK_4[0]);
$res_img = $rEXPVK_2[0];
$result_title = $rEXPVK_4[0];
if(!$result_title) $result_title = 'No name';
}
$result_img = $res_img;
                    
                    if(!preg_match("/http:\/\/vk.com|http:\/\/www.vk.com/i", $video_lnk));
                        $result_title = trim(strip_tags(strtr($res_title, array(''' => "'", '&quot;' => '"', '&iqu;' => '[', '&iqu2;' => ']')));
                    else
                        $result_title = trim(strip_tags($result_title));
                        
                    $result_descr = trim(strip_tags($res_descr));
                    
                    if($result_img && $result_title)
                        echo "{$result_img}:|:{$result_title}:|:{$result_descr}";
                    else
                        echo 'no_serviece';
                }
            } else
                echo 'no_serviece';
            
            die();
        break;

Complains with an error about:
$result_title = trim(strip_tags(strtr($res_title, array(''' => "'", '&quot;' => '"', '&iqu;' => '[', '&iqu2;' => ']'))));

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Inchin ☢, 2015-09-25
@In4in

Mama-ama, crime
Forgot to escape the quote.
That's why they say - do not type in a notepad, scribble in normal editors with highlighting.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question