Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function load_swaps()
- {
- $nen = nen_ini();
- $alt = array();
- $dat = file_get_contents( $nen[ 'root' ]. 'swaps.dat' );
- $swaps = explode( '\r\n', $dat );
- $index = 0;
- while( $index < count( $swaps ) )
- {
- $e = explode( ':', $swaps[ $index ] );
- if( count( $e ) > 0 )
- {
- $e = $swaps[ 0 ];
- $r = substr( $swaps[ $index ], 0, strlen( $e ) );
- $alt[ $e ] = $r;
- }
- $index++;
- }
- return $alt;
- }
- function perform_swaps( $pagedata = '' )
- {
- $alt = load_swaps();
- foreach( $alt as $key => $value )
- {
- echo $key;
- $pagedata = str_replace( '{{'. $key. '}}', $value, $pagedata );
- }
- return $pagedata;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement