Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //For those who want to change the output format from i.e.{“22″:”244mm”} to 244mm
- //The code to show will be
- $characters = preg_split(‘/”:”/’, $row[‘Custom1’], -1, PREG_SPLIT_NO_EMPTY); // ntx split string into two arrays before and after “:”
- $dirtybrand = array_slice($characters, 1); // split array into two strings and take the second one
- $cleanbrand = implode($dirtybrand); // convert array to string
- $brandprev = preg_split(‘/”/’, $cleanbrand, -1, PREG_SPLIT_NO_EMPTY); // split string $cleanbrand into two arrays , before and after ”
- $brand = array_slice($brandprev, 0, 1); // split array into two arrays and take only the first one
- $brandfinal = implode($brand); // convert array into string
- echo ($brandfinal) ; // show the string
- ?>
- This code will replace the original
- <?php echo $row['Custom1']; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement