- preg_match: documentation ( source)
- var_export: documentation ( source)
- preg_quote: documentation ( source)
<?php
$permalink_structure = '/index2php/converter/%post_id%/';
$index = 'index.php';
$without_preg_quote = preg_match( '#^/*' . $index . '#', $permalink_structure );
$with_preg_quote = preg_match( '#^/*' . preg_quote( $index, '#' ) . '#', $permalink_structure );
echo 'Without preg_quote(): ', var_export( $without_preg_quote, true ), "\n";
echo 'With preg_quote(): ', var_export( $with_preg_quote, true ), "\n";