Home Backend Development PHP Tutorial [100 days of lighting up PHP] Day 1: Another look at PHP, basic syntax_PHP tutorial

[100 days of lighting up PHP] Day 1: Another look at PHP, basic syntax_PHP tutorial

Jul 14, 2016 am 10:09 AM
php author use Basic sky light up first day write grammar

Written purely by the author himself. It aims to lead everyone to use optimistic and happy experiences to learn a skill that can make a living. Note: There is no better or worse among php, java, python, etc. The most important thing depends on which language you learn can help you make more money. Because generating profits and gaining a sense of accomplishment is the way to go.

Suitable for everyone
Comrades who have installed and configured php. If not, it is recommended to search for it on Baidu. This series does not cover initial installation and configuration.
Second-generation rich, second-generation officials, programmers with the ability, luck and network resources like Kai-Fu Lee, Jack Ma, and Ma Huateng, please close this page directly. This article may have wasted your precious time
Why should I write about php?
Dear, when you want to start a business or do some additional projects. php is your best helper because:
1. When you have insufficient resources, the small customers you find will not spend money to buy oracle or .net or java servers.
2. When you are short of funds, you are not willing to recruit some java employees.
3. When you talk about Python with early-stage small customers, most small customers will not agree with you, but PHP is different. Let’s introduce Taobao.
4. If you are working on the Internet (when you are just starting out), php is your best choice in the early stage.
5. Programmers who have had real entrepreneurial experience know that when you spend your energy developing an Iphone or other awesome products without any income. Letting your team use PHP to build some websites or OA is the best way to survive for a period of time.
php comments:
PHP is easy to use but difficult to control. Just like a boy or a girl who is very easy to catch up with, there may be big problems in the future. Either he (she) knocks you, or you knock everyone else. Therefore, when learning a language, you must learn to control it, ride it like a horse, rather than letting the horse ride you.
Regarding what is wrong with this article
This is normal, no need to make a fuss at all. There are times when the constitution needs to be revised.
The following is the text part:
(1) About page suffix
Since you write PHP, the page suffix is ​​always *.php. No reason, because our time is too precious. Don't always worry about URL rewriting, Du Niang is very smart now. Whether it is a website or software, if the content is good, she will definitely include it. No matter how friendly your URL is, today’s netizens won’t be able to remember it. I have a friend who makes a lot of money every day on Taobao. He doesn't even use the second-level domain name that comes with Taobao. That's because repeat customers only include your URLs. I can type out no more than 5 URLs by hand.
(2) About mark
When you use it means you are writing a php program. Don't go online to look up how to omit the php keyword behind
You can insert countless such code tags into the page, you can do whatever you like. (In fact, standard PHP projects all use templates + program analysis. I would like to add that novices should not struggle with this sentence, you will naturally learn it later)
(3) About $
PHP sets a variable starting with $, such as: $str='I don't like the United States'; This defines a variable named str, and I temporarily set its value to 'I don't like the United States'. Because maybe I suddenly feel that the United States is okay later, so I will set the value to 'I don't like Japan'. So this is called a "variable". Men are also fickle, please understand me.
(4) About + and.
1+1=?, everyone knows that it is 2. So in php $a=1+1; this $a is naturally 2. But the string addition uses '.', $a='1'.'1'; this $a is '11'. And it is also a string type. There is no reason, the founder of PHP loves this, you can do anything to him.
(5) About echo
PHP’s iconic syntax. echo "I don't like Japan";. You can immediately output this sentence that many people recognize on the page. If you don’t believe me, try it. Of course, I don’t mind if you change Japan to the name of some country.
(6) About single quotes and double quotes
Strings can be summarized in double quotes or single quotes. I like to use single quotes because you don't have to press the shift key to type them. Hope you like it too. Try not to use too many double quotes. One is to protect the left shift key from premature blurring. On the other hand, the $ variable inside the double quotes will be interpreted. I heard a great guy say that programs written by macho men never use double quotes. I looked in the mirror and thought I was okay.
That’s it. After learning the above grammar, it is definitely enough to learn so much on the first day. Next, tell a story.
The first time my roommate and I went to a company for an interview, because it was the first interview with my roommate and she was very scared and nervous. When I woke up in the morning and brushed my teeth, my roommate’s toothbrush brushed the wrong parts of his face several times in a row. I showed mercy and said I would go with you. So, I became the "cousin" of the roommate and went together.
The interviewer probably didn’t have breakfast and came here with messy hair. The two of us had already taken the lead in sitting in the interview conference room.
My roommate’s hand was shaking, and I noticed it from the corner of my eye, so I pressed his hand. The interviewer looked at me strangely. I pulled my hand back in horror.
After the interviewer knew that I was just a "cousin", he started asking questions about my roommate.
"How are you doing with PHP?". The interviewer's first question, I think this question is really difficult to answer.
"It's okay..." The roommate was extremely nervous.
The interviewer turns on his computer and asks his roommate to type "this is my world.it’s my test".
My roommates can still hold on at critical moments. Quickly hit the echo 'this is my world
it‘s my test‘;
"Great, can you change the way you write code?" The interviewer began to "tease" the roommate.
As a "cousin", I am also very anxious. I'm afraid that my roommate will be nervous. In fact, my roommate usually studies well, but when he gets nervous, his mind goes blank.
My roommate looked at me, and I responded with a "you can do it" look. My roommate told me with his eyes that he would work hard.
So the roommate played next. echo 'this is my world'.'
'.'it‘s my test';
"Write a few more!" The interviewer's expression was close to "obscene". At that time, I wanted to "descend" him as a "cousin".
Roommate, I really want to write it on behalf of my roommate. But do you think it’s possible?
At the critical moment, the interviewer’s phone rang. I personally guessed it was the interviewer’s wife’s phone number. The interviewer answered the phone with a pious expression. A soprano voice came from the other end of the phone, and the interviewer ran out in embarrassment.
During this gap, I quickly asked my roommate to give way. So I wrote down the sentence that finally allowed my roommate to pass the first round of interview.
1. echo 'this is my world','
','it‘s my test';
2. $string_1='this is my world';
$string_2='it‘s my test';
$sign='
';
$result=$string_1.$sign.$string_2;
3. $arr=array('this is my world','
','it‘s my test');
echo implode($arr);
Finish writing quickly and the interviewer will reply. After being chastened by the soprano, the interviewer's expression became noticeably gentler. I lowered my head and played with my phone, looking innocent.
The roommate’s hand left the keyboard just in time.
The interviewer seemed very satisfied and started to ask a few common questions. For example: Do you have a girlfriend? Do you plan to return to your hometown to develop in the future (you were in Beijing at the time)? Do you have the confidence to be an excellent programmer? Is renting a house stressful?
The roommate answered the interviewer with "no, no, yes, yes". As a "cousin", I echoed with "no, yes, no, yes" to highlight the greatness of my roommate.
A few years later, it was said that the roommate was doing well, and the answer to the above question became "yes, yes, yes, no".

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477573.htmlTechArticlePurely written by the author. It aims to lead everyone to use optimistic and happy experiences to learn a skill that can make a living. Note: There is no one good or bad among php, java, python, etc. The most important thing is...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1670
14
PHP Tutorial
1274
29
C# Tutorial
1256
24
PHP: A Key Language for Web Development PHP: A Key Language for Web Development Apr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP vs. Python: Understanding the Differences PHP vs. Python: Understanding the Differences Apr 11, 2025 am 12:15 AM

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

PHP and Python: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP in Action: Real-World Examples and Applications PHP in Action: Real-World Examples and Applications Apr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

The Enduring Relevance of PHP: Is It Still Alive? The Enduring Relevance of PHP: Is It Still Alive? Apr 14, 2025 am 12:12 AM

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP and Python: Different Paradigms Explained PHP and Python: Different Paradigms Explained Apr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP vs. Other Languages: A Comparison PHP vs. Other Languages: A Comparison Apr 13, 2025 am 12:19 AM

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP and Python: Code Examples and Comparison PHP and Python: Code Examples and Comparison Apr 15, 2025 am 12:07 AM

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

See all articles