Guest User

Untitled

a guest
May 25th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. function makeLinks( &$arr ) {
  2. foreach( $arr as $key=>$value ) {
  3. if( isset( $value[ 'description' ] ) ) {
  4. $pattern = '/(https?\S+)(\s*)/';
  5. $replacement = '<a href="$1">$1</a>$2';
  6. $value['description'] = preg_replace( $pattern, $replacement, $value['description'] );
  7. print_r2( $value['description'] );
  8. }
  9. }
  10. print_r2( $arr );
  11. }
Add Comment
Please, Sign In to add comment