পি.এইচ.পি.তে ডাটার প্রকার ভেদ; ডাটা টাইপ ~~Hedaet Forum~~


Email: Password: Forgot Password?   Sign up
Are you Ads here? conduct: +8801913 364186

Forum Home >>> Php, MySql >>> পি.এইচ.পি.তে ডাটার প্রকার ভেদ; ডাটা টাইপ

Tamanna
Modarator Team
Total Post: 7639

From:
Registered: 2011-12-11
 

পি.এইচ.পি.তে ডাটার প্রকার ভেদ; ডাটা টাইপ

ডাইনামিক এবং ইন্ট্রাকটিভ ওয়েব সাইট তৈরির জন্য PHP একটা শক্তিশালি ল্যাঙ্গুয়েজ।এতে বিভিন্ন ধরণের ডাটা নিয়ে কাজ করতে হয়। অন্যান্য প্রগ্রামিং ল্যাঙ্গুয়েজ এর সাথে এর কিছুটা পার্থক্য আছে, যেমন প্রোগ্রামিং সি এর ক্ষেত্রে ডাটা টাইপ প্রথমেই ভেরিয়েবল ডিক্লেয়ার করার সময় উল্লেখ করে দিতে হয়, কিন্তু পি এইচ পি তে তার প্রয়োজন নেই।পি. এইচ. পি. তে ডাটাকে প্রধানত ছয় প্রকারে বিভক্ত করা যায়। যেমন, Intiger (ইন্টিজার), Float / Double (ফ্লট বা ডাবল), Boolean (বুলিয়ান), String (স্ট্রিং), Array (এরে) এবং Object (অবজেক্ট)

এর একটি উদাহরণ হিসেবে নিচের কোড গুলো লক্ষ্য করুন
প্রথমে লিখি, <html> , পরের লাইনে লিখি,
<head>
পরের লাইনে লিখি,
<title>Dynamic Variable</title>
পরের লাইনে লিখি,
<style>
পরের লাইনে লিখি,
body{background:#FC9;}
পরের লাইনে লিখি,
</style>
পরের লাইনে লিখি,
</head>
পরের লাইনে লিখি,
<body>
পরের লাইনে লিখি,
<?php
পরের লাইনে লিখি,
$x=256;
পরের লাইনে লিখি,
echo $x;
পরের লাইনে লিখি,
echo \"<br />\";
পরের লাইনে লিখি,
$y=-560;
পরের লাইনে লিখি,
echo $y;
পরের লাইনে লিখি,
echo \"<br />\";
পরের লাইনে লিখি,
?>
পরের লাইনে লিখি,
<?php
পরের লাইনে লিখি,
$p=297.64;
পরের লাইনে লিখি,
echo $p;
পরের লাইনে লিখি,
echo \"<br />\";
পরের লাইনে লিখি,
$q=-765.23;
পরের লাইনে লিখি,
echo $q;
পরের লাইনে লিখি,
echo \"<br />\";
পরের লাইনে লিখি,
?>
পরের লাইনে লিখি,
<?php
পরের লাইনে লিখি,
$m=false;
পরের লাইনে লিখি,
echo $m;
পরের লাইনে লিখি,
echo \"<br />\";
পরের লাইনে লিখি,
$n=true;
পরের লাইনে লিখি,
echo $n;
পরের লাইনে লিখি,
echo \"<br />\";
পরের লাইনে লিখি,
?>
পরের লাইনে লিখি,
</body>
পরের লাইনে লিখি,
</html>
উপরের কোড নোটপ্যাডে লেখার পর, নোটপ্যাডের File মেনুতে ক্লিক করে, Save as এ ক্লিক করার পর, File name এ datatype.php দিয়ে Save as type এর ড্রপ ডাউন হতে All files সিলেক্ট করার পর, Save এ ক্লিককরে Save করতে হবে। datatype.php ফাইলটিকে ব্রাউজারের মাধ্যমে প্রদর্শন করার পূর্বে datatype.php ফাইলটিকে C:\\xampp\\htdocsঅর্থাৎ htdocs ফোল্ডারের মধ্যে রাখতে হবে। ব্রাউজারের datatype.php মাধ্যমে প্রদর্শন করার পূর্বে আমাদের নিশ্চিৎ হয়ে নিতে হবে xampp অর্থাৎ Apachi সার্ভার Running অবস্থায় আছে। xampp Running অবস্থায় থাকলে first.php ফাইলটি ব্রাউজারে দেখানোর জন্য এড্রেস বারে লেখতে হবে http://localhost/ datatype.php ।তাহলে ব্রাউজারে দেখাবে।

Pieicapite through the data type; Data Type

PHP web site for the creation of a strong and dynamic intrakatibha lyanguyejaete to work with different kinds of data. There are some differences with other pragramim of language, such as C's case to specify the data type when you declare variables in the first place, but her need PHP neipi H. P. Mainly on the data can be divided into six types. For example, Intiger (integers), Float / Double (phlata or double), Boolean (Boolean), String (String), Array (Array), and Object (object)

As an example, consider the following code
First, write, <html>, type the following line,
<Head>
Write the next line,
<Title> Dynamic Variable </ title>
Write the next line,
<Style>
Write the next line,
body {background: # FC9;}
Write the next line,
</ Style>
Write the next line,
</ Head>
Write the next line,
<Body>
Write the next line,
<? Php
Write the next line,
$ X = 256;
Write the next line,
echo $ x;
Write the next line,
echo \ "<br /> \";
Write the next line,
$ Y = -560;
Write the next line,
echo $ y;
Write the next line,
echo \ "<br /> \";
Write the next line,
?>
Write the next line,
<? Php
Write the next line,
$ P = 297.64;
Write the next line,
echo $ p;
Write the next line,
echo \ "<br /> \";
Write the next line,
$ Q = -765.23;
Write the next line,
echo $ q;
Write the next line,
echo \ "<br /> \";
Write the next line,
?>
Write the next line,
<? Php
Write the next line,
$ M = false;
Write the next line,
echo $ m;
Write the next line,
echo \ "<br /> \";
Write the next line,
$ N = true;
Write the next line,
echo $ n;
Write the next line,
echo \ "<br /> \";
Write the next line,
?>
Write the next line,
</ Body>
Write the next line,
</ Html>
After writing the above code notepad, Notepad, click the File menu, Save as, after clicking, File name in the Save as type drop-down datatype.php to select the All files, Save Save the klikakare to do. File Browser displays the file before datatype.php datatype.php C: \\ xampp \\ htdocs should be in the htdocs folder. Datatype.php browser before the show that will take us to be sure that xampp is Running Apachi server. If xampp Running first.php to write to the file in the browser address bar to show the http: // localhost / datatype.php She says the browser will display.