String Uitsny in PHP
substrmb_substrmb_strcutЗадание 1
Gegee 'n string:
php<?php
$str = 'html css php';
?>
Sny uit ons string en vertoon op die skerm:
php'html'
'css'
'php'
Задание 2
Gegee 'n string:
php<?php
$str = 'abcdefgh';
?>
Vertoon die laaste 3 karakters:
php'fgh'
Задание 3
Gegee 'n string:
php<?php
$str = 'http://example.com';
?>
Gaan na of dit begin met 'http://':
Задание 4
Gegee 'n string:
php<?php
$str = 'https://example.com';
?>
Gaan na of dit begin met 'http://' of 'https://':
Задание 5
Gegee 'n string:
php<?php
$str = 'image.png';
?>
Gaan na of dit eindig met '.png':
Задание 6
Gegee 'n string:
php<?php
$str = 'photo.jpg';
?>
Gaan na of dit eindig met '.png' of '.jpg':
Задание 7
Gegee 'n string:
php<?php
$str = 'This is a long string';
?>
As daar meer as 5 karakters is, vertoon die eerste 5 met drie kolletjies, anders die hele string:
php'This ...'
Задание 8
Gegee 'n string:
php<?php
$str = 'многобайтовые строки требуют особого подхода';
?>
Sny die laaste woord uit:
php'подхода'
Задание 9
Gegee 'n string:
php<?php
$str = 'пример работы с кириллическими символами';
?>
Sny uit en vertoon:
php'работы'
'кириллическими'