Skip to content

Converting ereg to preg_match after switch to PHP7 #3

Description

@imtwebdev

Hi,
I'd like to propose this fix for the file syntax.php to convert ereg call (removed in PHP7) in preg_match

function property($prop, $xml)
{
        # fixed closed parentheses
	$pattern ="/".$prop ."='([^']*)'"."/";
        # ereg > preg_match
        if (preg_match($pattern, $xml, $matches)) {
		return $matches[1];
	}
	# fixed closed parentheses
        $pattern ="/". $prop .'="([^"]*)"'.'/';
        # ereg > preg_match
        if (preg_match($pattern, $xml, $matches)) {
		return $matches[1];
	}
	FALSE return;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions