Cara menggunakan php get base path

Learn PHP

PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.

PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.

Start learning PHP now »

Easy Learning with "PHP Tryit"

With our online "PHP Tryit" editor, you can edit the PHP code, and click on a button to view the result.

Example




Try it Yourself »

Click on the "Try it Yourself" button to see how it works.

PHP Exercises

PHP Examples

Learn by examples! This tutorial supplements all explanations with clarifying examples.

See All PHP Examples

PHP Quiz Test

Learn by taking a quiz! This quiz will give you a signal of how much you know, or do not know, about PHP.

Start PHP Quiz!

My Learning

Track your progress with the free "My Learning" program here at W3Schools.

Log into your account, and start earning points!

This is an optional feature. You can study W3Schools without using My Learning.

PHP References

W3Schools' PHP reference contains different categories of all PHP functions, keywords and constants, along with examples.


Kickstart your career

Get certified by completing the course

Get certified

w3schoolsCERTIFIED.2022



Pertanyaan sederhana, tetapi jawabannya sepertinya cukup sulit didapat. Di Codeigniter, saya bisa memuat pembantu url dan kemudian lakukan saja

echo base_url[];

untuk mendapatkan URL situs saya. Apakah ada yang setara di Laravel?

Anda dapat menggunakan fasad URL yang memungkinkan Anda melakukan panggilan ke generator URL

Jadi kamu bisa melakukan:

URL::to['/'];

Anda juga dapat menggunakan wadah aplikasi:

$app->make['url']->to['/'];
$app['url']->to['/'];
App::make['url']->to['/'];

Atau menyuntikkan UrlGenerator:

Bài mới nhất

Chủ Đề