add pdf and mobi libraries

This commit is contained in:
tcit
2014-07-24 15:49:36 +02:00
parent 2b58426b2d
commit 4188f38ad5
297 changed files with 126557 additions and 7 deletions

View File

@ -0,0 +1,37 @@
<?php
/**
* Utils for news2kindle
* @author jwest <jwest@jwest.pl>
*/
class Utils
{
/**
* URL encode
* @param string $url
* @return string $ar_url
*/
public static function urlencode( $url )
{
$ar_url = explode( '/', $url );
foreach ( $ar_url as $key => $val )
{
$ar_url[ $key ] = urlencode( $val );
}
return implode('/', $ar_url );
}
/**
* Prepare ID for google rss article
* @param string $id
* @return string
*/
public static function prepare_id($id)
{
$char_in = array('/', '.', ',', ':');
$id = str_replace($char_in, '-', $id);
return $id;
}
}