محاضرة 4
Built-In Functions & URLs
الدوال المدمجة للـ Strings والـ Arrays، وهيكل الـ URL.
يلا نشوف الملخص
Lecture 4: Built-In Functions & URLs
Overview: Covers essential PHP native functions for string and array manipulation, alongside understanding URL structures.
- String Built-In Functions:
strlen(): Returns the length of a string.strpos(): Finds the position of the first occurrence of a substring.substr(): Extracts and returns a part of a string.str_replace(): Replaces occurrences of a specified search string with a replacement string.strtolower(): Converts the entire string to lowercase.strtoupper(): Converts the entire string to uppercase.trim(): Removes whitespace (or other specified characters) from both ends of a string.md5(): Calculates the MD5 hash of a string.filter_var(): Filters a variable using a specified filter (e.g., validating an email).
- Array Built-In Functions:
count(): Counts the total number of elements in an array.array_push(): Pushes one or more elements to the end of an array.array_pop(): Pops (removes) the last element off the end of an array.array_shift(): Shifts (removes) the first element off the beginning of an array.array_unshift(): Prepends (adds) one or more elements to the beginning of an array.array_merge(): Merges two or more arrays together.array_reverse(): Reverses the order of the array's elements.in_array(): Checks if a specific value exists inside an array.
- HTML Uniform Resource Locators (URL):
- A URL is a web address used to locate documents or data on the web.
- Structure:
scheme://prefix.domain:port/path/filename- scheme: The internet service type (e.g., http or https).
- prefix: The domain prefix (default is www).
- domain: The internet domain name (e.g., w3schools.com).
- port: Port number at the host (default for http is 80).
- path: Path at the server (omitted path defaults to the root directory).
- filename: Name of the specific document or resource.
في نقطة مش واضحة؟ بطبط موجود!
اسأل بطبط عنها