将angularjs值传递给PHP变量 [英] Pass angularjs value to PHP variable

查看:100
本文介绍了将angularjs值传递给PHP变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从ngStorage开始使用angularjs.我可以成功保存和显示数据.

I am starting with angularjs with ngStorage. I can save and display data successfully.

我像以前一样显示值

{{myobj.session}}

我想将任何存储的值传递给php变量.下面显示的是我的假想逻辑,我知道那是行不通的.我的问题是如何以正确的方式将此类值分配给PHP变量?

I would like to pass whatever stored value into php variable. Shown below is my imaginary logic and I know thats not gonna work. My question is how to assign such value into PHP variable in a correct manner?

<?php 
    $name = {{myobj.session}}
?>

推荐答案

您可以使用以下角度变量:students.tiffen_type
PHP变量:$value

You can use this angular variable: students.tiffen_type
PHP variable : $value

<?php
    $value = "{{ students.tiffen_type }}";
?>

这篇关于将angularjs值传递给PHP变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆