문자열(string) Sample

<?php
/**
 * String helper
 *
 * Created on 2011. 11. 18.
 * @author 불의회상 <hoksi2k@hanmail.net>
 * @package helper
 * @subpackage controllers
 * @version 1.0
 */
class String_hlp extends CI_Controller {
	function __construct()
	{
		parent::__construct();
		
		$this->load->helper('string');
	}
	
	function index() {
		$fname = 'file'; 
		for($i=0;$i<5;$i++) {
			$fname = increment_string($fname);
			$data['increment_string'][] = $fname;
		}
		
		$data['alternator'] = '';
		for ($i = 0; $i < 10; $i++) {
    		$data['alternator'] .= alternator('string one ', 'string two ');
		}
		
		$this->load->view('string_hlp_sample', $data);
	}
}
<?php $this->load->view('inc/header')?>

<table class="tablesorter" border="0" cellpadding="0" cellspacing="1">
<thead>
<tr>
  <th style="text-align:center" width="20%">구분</th>
  <th width="80%">결과</th>
</tr>
</thead>
<tr>
  <th style="text-align:center" colspan="2">random_string()</th>
</tr>
<tr>
	<td>random_string()</td>
	<td><?php echo random_string()?></td>
</tr>
<tr>
	<td>random_string('alpha', 16)</td>
	<td><?php echo random_string('alpha', 16)?></td>
</tr>
<tr>
	<td>random_string('alnum')</td>
	<td><?php echo random_string('alnum')?></td>
</tr>
<tr>
	<td>random_string('numeric')</td>
	<td><?php echo random_string('numeric')?></td>
</tr>
<tr>
	<td>random_string('nozero')</td>
	<td><?php echo random_string('nozero')?></td>
</tr>
<tr>
	<td>random_string('numeric')</td>
	<td><?php echo random_string('numeric')?></td>
</tr>
<tr>
	<td>random_string('unique')</td>
	<td><?php echo random_string('unique')?></td>
</tr>
<tr>
	<td>random_string('md5')</td>
	<td><?php echo random_string('md5')?></td>
</tr>
<tr>
	<td>random_string('encrypt')</td>
	<td><?php echo random_string('encrypt')?></td>
</tr>
<tr>
	<td>random_string('sha1')</td>
	<td><?php echo random_string('sha1')?></td>
</tr>
<tr>
  <th style="text-align:center" colspan="2"> </th>
</tr>
<tr>
	<td>increment_string()</td>
	<td><xmp><?php print_r($increment_string)?></xmp></td>
</tr>
<tr>
	<td>alternator()</td>
	<td><?php echo $alternator?></td>
</tr>
<tr>
	<td>repeater('*', 10)</td>
	<td><?php echo repeater('*', 10)?>
	</td>
</tr>
<tr>
	<td>reduce_double_slashes('http://example.com//index.php')</td>
	<td><?php echo reduce_double_slashes('http://example.com//index.php')?>
	</td>
</tr>
<tr>
	<td>trim_slashes('/this/that/theother/s')</td>
	<td><?php echo trim_slashes('/this/that/theother/s')?>
	</td>
</tr>
<tr>
	<td>reduce_multiples('Fred, Bill,, Joe, Jimmy')</td>
	<td><?php echo reduce_multiples('Fred, Bill,, Joe, Jimmy')?>
	</td>
</tr>
<tr>
	<td>quotes_to_entities("Joe's \"dinner\"")</td>
	<td><?php echo quotes_to_entities("Joe's \"dinner\"")?>
	</td>
</tr>
<tr>
	<td>strip_quotes("Joe's \"dinner\"")</td>
	<td><?php echo strip_quotes("Joe's \"dinner\"")?>
	</td>
</tr>
</table>

<?php $this->load->view('inc/footer')?>

© Copyright by hoksi(Page rendered in 0.0072 seconds)