Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function trk_fastregex( $pagedata = '' )
- {
- $pattern = '/([\w\s.]*)({{(prj)\|([^|{}.]*)}})([\w\s.]*)/';
- $replace = '{{$1}}<a href="./?({{$3}})={{$4}}">{{$4}}</a>{{$5}}';
- $subject = $pagedata;
- $matches = array();
- for( ; preg_match_all( $pattern, $pagedata, $matches ) ; )
- {
- foreach( $matches as $key => $value )
- {
- $subject =
- str_replace(
- '{{' . '$' . strval( $key + 1 ) . '}}',
- $value,
- $subject
- );
- }
- $matches = array();
- }
- $pagedata = $subject;
- return $pagedata;
- }
- ?>
- Error Line:
- $subject
- Error Message:
- Fatal error: Uncaught TypeError: str_replace(): Argument #2 ($replace) must be of type string when argument #1 ($search) is a string in C:\xampp8\htdocs\puzzlum.net\php\trk swaps.php:22 Stack trace: #0 C:\xampp8\htdocs\puzzlum.net\php\trk swaps.php(22): str_replace('{{$1}}', Array, '<style>{{font.m...') #1 C:\xampp8\htdocs\puzzlum.net\index.php(129): trk_fastregex('<style>{{font.m...') #2 {main} thrown in C:\xampp8\htdocs\puzzlum.net\php\trk swaps.php on line 22
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement