I’m relatively new to PHP. I’m wondering if it’s possible to simply create a variable from an HTML element like a <p> tag or a <div>?
All I’m looking for is a string variable which I can then use to register a new user through WordPress. I have all of the user information available to me in JavaScript variables and displaying on the page.
If this isn’t possible I’m not quite sure how I would go about using AJAX to do a simple conversion to get those JS variables to PHP variables.
The code is quite long at this point, filled unrelated stuff. All that I have on the page that is related is a box displaying 3 <p> tags (each of which are also available already as JS variables – which I’m trying to pass into the wp_create_user function.
If I understood you right, you’re talking about “variable variables”
just take any string and use it as variable’s name. Use double $$ sign for this.
quick example: