Reseller Domain Murah dan termurah di Indonesia? ya di ResellerCamp.
         
 

Forum PHP Indonesia

 
Advanced Search
   
 
Home Register FAQ Memberlist Usergroups  
 
 

Forum PHP Indonesia Forum Index Session & Cookie "masih bingung soal isset"
Display posts from previous:   
      All times are GMT + 7 Hours  

"masih bingung soal isset"

Post new topic  Reply to topic Goto page 1, 2  Next

Sat Apr 11, 2009 17:40
Author Message
curaph
PHPuser
PHPuser


Joined: 11 Apr 2009
Posts: 36
Location: pamulang

Post subject: "masih bingung soal isset" Reply with quote

0m tolong dong jelasin fungsi dan cara gunain 'isset' dari kemarin saya coba pelajarin tapi masih belum paham juga hehehe....

tolong ya 0m..

thank.. Cry
_________________
Good Morning
 
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
      Back To Top  

Sun Apr 12, 2009 05:43
Author Message
fasisi
PHPnewbie
PHPnewbie


Joined: 28 Mar 2009
Posts: 17

Post subject: Reply with quote

halo,

isset adalah fungsi untuk memeriksa apakah suatu variabel sudah diberikan nilai atau di-set nilainya.

misalnya:

isset(POST[btnOK])

itu memeriksa apakah item btnOK dalam array POST sudah ada nilainya atau belum. kalau ada, isset mengembalikan true, kalau tidak ada, isset mengembalikan false.

semoga membantu.

fasisi
_________________
fasisi
www.pasar-programmer.com - wadah ketemu antara programmer dan calon user
 
View user's profile Send private message Visit poster's website
      Back To Top  

Mon Apr 13, 2009 00:14
Author Message
.
Super Master PHP
Super Master PHP


Joined: 05 Apr 2008
Posts: 2225

Post subject: Reply with quote

punya php manual kan?
kurang lengkap?

contoh juga ada di situ...
_________________
#ccdbea
Juliet: "What's in a name? That which we call a rose by any other name would smell as sweet."
Hamlet: "To be, or not to be: that is the question."
- William Shakespeare -
 
View user's profile Send private message
      Back To Top  

Mon Apr 13, 2009 05:04
Author Message
bayuputra
Jagoan PHP
Jagoan PHP


Joined: 08 Nov 2008
Posts: 564
Location: Solo

Post subject: Reply with quote

nambahin ya om :

ni aku paste in dari PHP manual om :

isset
(PHP 4, PHP 5)

isset — Determine whether a variable is set

Description
bool isset ( mixed $var [, mixed $var [, $...]] )

Determine whether a variable is set.

If a variable has been unset with unset(), it will no longer be set. isset() will return FALSE if testing a variable that has been set to NULL. Also note that a NULL byte ("\0") is not equivalent to the PHP NULL constant.


jadi fungsi dari isset itu untuk mengecek apakah suatu variable sudah/pernah diberi nilai atau belum. jika sudah pernah maka mengembalikan nilai true, jika belum false
_________________
I want to share with you

http://belugerinstudios.com

----.o0 ME=SHARED 0o.----
 
View user's profile Send private message Send e-mail Yahoo Messenger
      Back To Top  

Mon Apr 13, 2009 12:31
Author Message
curaph
PHPuser
PHPuser


Joined: 11 Apr 2009
Posts: 36
Location: pamulang

Post subject: Reply with quote

makasih y om... tapi kasih contoh dong...
sekalian penjelasannya... heheheh..

maklum masih baru!!
_________________
Good Morning
 
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
      Back To Top  

Tue Apr 14, 2009 15:00
Author Message
.
Super Master PHP
Super Master PHP


Joined: 05 Apr 2008
Posts: 2225

Post subject: Reply with quote

buka php manual dong... ada contoh nya di situ...
_________________
#ccdbea
Juliet: "What's in a name? That which we call a rose by any other name would smell as sweet."
Hamlet: "To be, or not to be: that is the question."
- William Shakespeare -
 
View user's profile Send private message
      Back To Top  

Wed Apr 15, 2009 12:24
Author Message
curaph
PHPuser
PHPuser


Joined: 11 Apr 2009
Posts: 36
Location: pamulang

Post subject: Reply with quote

oy mas makasih y...
Alhamdulillah skrg dah fahammmmmm hehehe...
_________________
Good Morning
 
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
      Back To Top  

Thu Apr 16, 2009 02:33
Author Message
RoNz
Jagoan PHP
Jagoan PHP


Joined: 13 Apr 2009
Posts: 485
Location: Kerinci

Post subject: Reply with quote

Tambahin lg y mas, siapa tahu membantu. :D
Code:
<?php $variabel "abcd";
$hasil = isset($variabel); //Hasilnya true
$hasil = empty($variabel); //Hasilnya false; ?>

Null bukan kosong, dan kosong bukan Null. Karena kosong adalah suatu nilai, sedangkan Null belum diberi nilai sama sekali.

isset() gunanya utk memeriksa apakah suatu variabel telah diberi nilai atau belum. Jika belum, berarti variabel tsb belum dideklarasikan atau NULL.

empty() gunanya utk memeriksa apakah suatu variabel telah diberi nilai namun kosong.


Begitulah kira2 perbedaannya mas. :D
 
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
      Back To Top  

Sat May 01, 2010 17:01
Author Message
labcom_marko
PHPuser
PHPuser


Joined: 01 Mar 2010
Posts: 32

Post subject: Reply with quote

thanx jagoan php..
tapi tanpa isset kita bisa memeriksa suatu nilai tersebut ga??
 
View user's profile Send private message
      Back To Top  

Sun May 23, 2010 04:51
Author Message
misbakhuddin0707
Anak Baru
Anak Baru


Joined: 13 Mar 2010
Posts: 4
Location: jl.sidodadi 44 babadan ponorogo

Post subject: Reply with quote

Salute! jadi tahu ane bang.'! Salute!
 
View user's profile Send private message
      Back To Top  

Thu Jun 03, 2010 01:44
Author Message
musicanda
PHP Master
PHP Master


Joined: 02 Jun 2010
Posts: 263
Location: Rumahnya Angeline

Post subject: Reply with quote

labcom_marko wrote:
thanx jagoan php..
tapi tanpa isset kita bisa memeriksa suatu nilai tersebut ga??


boleh kk....

misalnya :

if (isset($_session['id'])) {

...

}

boleh di ganti dgn fungsi empty() untuk memeriksa suatu nilai...
jadinya skrip nya gan berikut :

if(!empty($_session['id'])) {

...

}
 
View user's profile Send private message Send e-mail Visit poster's website
      Back To Top  

Fri Jul 30, 2010 10:34
Author Message
Alvin313
PHP Programmer
PHP Programmer


Joined: 14 Mar 2010
Posts: 85
Location: Jakarta

Post subject: Reply with quote

oh empty itu kebalikan dari isset,baru tau
_________________
a simple programming ronin
 
View user's profile Send private message
      Back To Top  

Sat Mar 05, 2011 00:59
Author Message
denmasferiyanto
PHPnewbie
PHPnewbie


Joined: 03 Mar 2011
Posts: 11
Location: BaNewMust

Post subject: Reply with quote

RoNz wrote:
Tambahin lg y mas, siapa tahu membantu. :D
Code:
<?php $variabel "abcd";
$hasil = isset($variabel); //Hasilnya true
$hasil = empty($variabel); //Hasilnya false; ?>

Null bukan kosong, dan kosong bukan Null. Karena kosong adalah suatu nilai, sedangkan Null belum diberi nilai sama sekali.

isset() gunanya utk memeriksa apakah suatu variabel telah diberi nilai atau belum. Jika belum, berarti variabel tsb belum dideklarasikan atau NULL.

empty() gunanya utk memeriksa apakah suatu variabel telah diberi nilai namun kosong.


Begitulah kira2 perbedaannya mas. :D

kalo ada input (misal input name : USER) dalam sebuah form dibiarkan kosong terus disubmit., nanti nilai USER tersebut NULL atau EMPTY ???
 
View user's profile Send private message
      Back To Top  

Sat Mar 05, 2011 03:52
Author Message
squidy
PHP Programmer
PHP Programmer


Joined: 11 Feb 2011
Posts: 154
Location: Purwokerto

Post subject: Reply with quote

The following things are considered to be empty:

"" (an empty string)
0 (0 as an integer)
"0" (0 as a string)
NULL
FALSE
array() (an empty array)
var $var; (a variable declared, but without a value in a class)
 
View user's profile Send private message Visit poster's website Yahoo Messenger
      Back To Top  

Sun Mar 06, 2011 11:12
Author Message
ichang
PHP Programmer
PHP Programmer


Joined: 02 Mar 2011
Posts: 57

Post subject: Reply with quote

makasih master
 
View user's profile Send private message
      Back To Top  
Post new topic  Reply to topic Goto page 1, 2  Next

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


      Back To Top  

Page 1 of 2
Goto page 1, 2  Next
Jump to:  
Powered by phpBB © 2001, 2002 phpBB Group
Toko Kaos Couple | Avalanche style by What Is Real © 2004 | Toko Baju Butik Online | Cara Pedia | Busana Baju Muslim