Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.
- $sum = 0;
- for($i = 0; $i < count($arr); $++){
- $sum += $arr[$i];
- }
- 2.
- $hostname = 'hostname';
- $username = 'username';
- $password = 'password';
- $dbName = 'dbName';
- $table = 'table';
- $delId = 'delId';
- $mysqli = new mysqli($hostname, $username, $password, $dbName);
- $mysqli->query('DELETE FROM '.$table.' WHERE id = "'.$delId.'"');
- $mysqli->close();
- 3.
- $path = getcwd();
- $objects = scandir($path);
- foreach($objects as $file){
- $new_file = $path.'/'.$file;
- if(is_file($new_file)){
- echo $file.'<br>';
- }
- }
- 4.
- $array = array(3, 1, 2, 4);
- sort($array);
- foreach($array as $elem){
- echo $elem.'<br>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement