formats

[php - string] String Manipulation part 1

String manipulation ini rencana penulis pake pada salah satu aplikasi yang menggunakan ID Unique sebagai pengenal, misalnya :

Unique ID = 20071201081535001

ket.

unique ID ini terdiri dari kombinasi “yyyy mm dd hh mm ss ID” misalnya anda ingin mengambil value ID yg nilainya 001

$id=20071201081535001

$result=substr($id,-3,3)

atau

$result=substr($id,15,3)

hasilnya : 001

thank’s to : http://dev.fyicenter.com/faq/php/php_string_function.php

Tulisan yang mungkin se-ide

Leave a Reply

Your email address will not be published. Required fields are marked *

*

* Copy this password:

* Type or paste password here:

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Home Komunitas Kami News [php - string] String Manipulation part 1
credit
© komunitaskami.com