📜  如何在 PHP 代码示例中创建和访问角度 HTTP 参数

📅  最后修改于: 2022-03-11 14:54:27.850000             🧑  作者: Mango

代码示例1
//Crreating HTTP params
//e.g. http://localhost/api/something.php?title=value&content=value
let httpParams = new HttpParams()
  .set('title', this.createNewForm.controls['title'].value)
  .set('content', this.createNewForm.controls['content'].value);

//Then pass the Http params object to the http.get) method
this.http.get('http://localhost/api/something.php', {httpParams}).then();

//Accessing these parameters in PHP
$title = $_GET['title'];
$title = $_GET['content'];