السلام عليكم
اثناء لتصفحى لموقع انجلزي لتعلم php وجدت بعض الاكواد لم افهم لماذا هي او ما فائدتها الصق لكم الشرح كعلني اجد مفهومها
PHP - String Creation Double-Quotes
We have used double-quotes and will continue to use them as the primary method for forming strings. Double-quotes allow for many special escaped characters to be used that you cannot do with a single-quote string. Once again, a backslash is used to escape a character.
PHP Code:
$newline = "A newline is \n"; $return = "A carriage return is \r"; $tab = "A tab is \t"; $dollar = "A dollar sign is \$"; $doublequote = "A double-quote is \"";
Note: If you try to escape a character that doesn't need to be, such as an apostrophe, then the backslash will show up when you output the string.
These escaped characters are not very useful for outputting to a web page because HTML ignore extra white space. A tab, newline, and carriage return are all examples of extra (ignorable) white space. However, when writing to a file that may be read by human eyes these escaped characters are a valuable tool!
ماذا فائدة هذا الكود
PHP Code:
$newline = "A newline is \n"; $return = "A carriage return is \r"; $tab = "A tab is \t"; $dollar = "A dollar sign is \$"; $doublequote = "A double-quote is \"";
انا اعلم انها متغيرات لكن ما فائدة
\n
\r
\t
\$
\"
التي مكتوبه بالكود