Duniaweb Blog

Your Interner Life Partner

str_replace

str_replace digunakan untuk mengganti karakter
Bentuk asli:
str_replace(“asli”, “baru”, $str);

Contoh:
$str = “anggi jatras mara aaa”;
$ganti = str_replace(” “, “_”, $str);
echo $ganti;

Hasil yg keluar:
==> anggi_jatras_mara_aaa

Ket: Sesuai contoh saya mengganti semua spasi menjadi underscore

September 20, 2008 - Posted by | PHP Reference

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: