]> git.immae.eu Git - github/wallabag/wallabag.git/blob - inc/3rdparty/libraries/send2kindle/utils.php
add pdf and mobi libraries
[github/wallabag/wallabag.git] / inc / 3rdparty / libraries / send2kindle / utils.php
1 <?php
2 /**
3 * Utils for news2kindle
4 * @author jwest <jwest@jwest.pl>
5 */
6 class Utils
7 {
8 /**
9 * URL encode
10 * @param string $url
11 * @return string $ar_url
12 */
13 public static function urlencode( $url )
14 {
15 $ar_url = explode( '/', $url );
16
17 foreach ( $ar_url as $key => $val )
18 {
19 $ar_url[ $key ] = urlencode( $val );
20 }
21
22 return implode('/', $ar_url );
23 }
24
25 /**
26 * Prepare ID for google rss article
27 * @param string $id
28 * @return string
29 */
30 public static function prepare_id($id)
31 {
32 $char_in = array('/', '.', ',', ':');
33 $id = str_replace($char_in, '-', $id);
34
35 return $id;
36 }
37 }