Importent Notes

 1.URI Segment

Using CodeIgniter URL class’s function, we can retrieve information from URI string. In this tutorial we are going to explain how we can use the URI class in CodeIgniter to retrieve information from URI segment.

uri segment url se data get krane k lie use hota hai indexing URL ke function ke indexing ke according specific data get karne ke lie use hota hai ..

2.&nbsp =in use space

3.flash data. kuch time k lie data store karta hai session mai

4.database se same data se jo register hai usse login k lie hum count   krenge for example if(count($valid)>0)  isme condition hai if k sath hai ki agr count $vaild mai jo data hai vo 0 se bada hai.

5.explode function= sting ko aaray mai convert ke lie use hota hai

6.implode function =array ko string mai convert karta hai

6.is_numeric function = Finds whether a variable is a number or a numeric string(ye varuable mai dekta hai ki value number ya numaric hai ya nahi


if(is_numeric($order_id)){

 $this->session->set_flashdata('flash_message', 'updated');

redirect('admin/pin/add');

  }else{

   $this->session->set_flashdata('flash_message', 'not_updated');

  }

iska meaning hai ki agar $order id ka under store data number mai hai to ek temprry session create hoga or data ko insert ya jo query lagi hai usme condition true hoke message updated show hoga or use page mai redarict krega  agr condition

faluse hoti hai to else wali conditon chlegi


7.'pinid' => random_string('alnum',6).random_string('alnum',4),

alnum  =is syntax mai alnum alfa numaric hai jo randomly alfa numeric data get krwata hai or jo number hai wo string ya syntex ki lenght hai 

8.array_marge  = 2 array ka data 1 aaray mai marge karte hai 1 array mai 2table ka data store ho jata hai.(the data of 2array is stored in 1 array.)

9.array_colum  Array_column () फ़ंक्शन इनपुट सरणी में sirf 1कॉलम से मान लौटाता है। for emap.ye sirf ek colum ka data hi get kraega  (Array_column () that returns a value from a single column in the input array.)

10.model=>query= mai limit ka use kissi condition ko limit di jati hai ki jo data hai isse jyada ni ho skta isme limit 10 tk ki di hai

model $this->db->limit(10);  

12.website close krne ke li hum main admin or view dono mai index file pe die();use krte hai

Zero It Soluation

1.var dump or print mai diffrence ye hai ki print r mai only data array mai deta hai bt var dump mai data object or string or array sbhi k sath deta hai 

2.Role  agr database k user table mai Admin or User ka role dia hai to hum Query mai is functon ko use krenge jo highlight kia hai red mai===>

public function add(){

//get all input filed data
$data=$this->input_values();
$password =md5($data['password']);
$data['password']=$password;
$data['role']='user';
if($this->db->insert('users', $data)){
return true;
}
return false;
}
3.Helper mai jo v function dete hai use hum website mai Kahi
v cll kra skte hai

4.Conf atoload mai hum koi v file lode karani hai jese helper, liberray, Model
sabhi config atoload se kra sakte hai
5.__dir__ in ajax php
The __DIR__ can be used to obtain the current code working directory. It has been introduced in PHP beginning from version 5.3. It is similar to using dirname(__FILE__). Usually, it is used to include other files that is present in an included file. ... php, it runs successfully.
6.Opperaters
a)==Equal ,Returns true if $x is equal to $y;
b)=== Identical,Returns true if $x is equal to $y, and they are of the same type
7.require_once =The require_once expression is identical to require except PHP will check if the file has already been included, and if so, not include (require) it again.
session =session is a globle variuable he store data and show in different web pages,
  1. session_unset - Frees all session variables (It is equal to using: $_SESSION = array(); for older deprecated code)
  2. unset($_SESSION['Products']); - Unset only Products index in session variable. (Remember: You have to use like a function, not as you used)
  3. session_destroy — Destroys all data registered to a session

9.type of session=

  • 1)inprocess session.
  • 2)out Process session.
  • 3)SQl-server session.

  • 10.include() function is not able to find a specified file on location at that time it will throw a warning message however, it will not stop script execution.

  • include_once() If the code from a file has been already included then it will not be added again if we use include_once().

    require_once() the code from a php file has been already included then it will not be included again if we use require_once(). It implies require_once() will add the file just once at a time. If it can’t locate a specified file, at that time it will generate a fatal error but it will stop the content execution.


  • required()The Require() function is also used to put data of one PHP file to another PHP file. If there are any errors then the require() function produces a warning and a fatal error and stops the execution of the script i.e. the script will continue to execute.


Object define             ->

unset password in object= foreach hmesha object data ko get karne ke lie hota hai  foreach($profile_data as $wo=>$vl){
unset($vl->password);

$profile[]=$vl;
}


Array define   =>
unset password in array
unset($users->password);



UNSET      yuuuffffffffffis uaddddd
unset use in hide data in API for example password 
unset($users->password);

json decode====>data showing in array (array mai dat show hota hai)


json incode=====> data jason mai show hota hai 

**multidemitional array ki data show krane ke lie hmm data ko foreach loop mai lete hai for exm data as key=>value ,$data[]=$vl;

Comments

Popular posts from this blog

condition in table data for html

my notepad code notes

React.js Notes