FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How to convert this PHP into JavaScript
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: How to convert this PHP into JavaScript [message #173151 is a reply to message #173146] Thu, 24 March 2011 18:05 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On Thu, 24 Mar 2011 07:23:56 -0700, Oltmans wrote:

> Hi PHP gurus, I hope you're doing well.
>
> I'm trying to convert a PHP script into JavaScript. I'm posting here
> because I don't know much PHP and I hope someone among you can help.
> Here is the PHP
>
> array(
> 'abc' => '1 AND (2 OR
> 3)', // Define how to use
> the following criteria
> 'def' => array('marketing_campaign_id', 'status',
> 'status'), // Filter by these three criteria
> 'ghi' => array('eq', 'eq',
> 'eq')
> );
>
>
> I need to convert above into JavaScript object which looks like
>
> {
>
> 'abc' : '1 AND (2 OR 3)'
> }
>
>
> but I don't know how to convert
>
> array('marketing_campaign_id', 'status', 'status')
>
> into equivalent JavaScript. Can someone please let me know how to
> convert above into JavaScript? I will really appreciate your help in
> this regard. Thanks!

Here is a display of some PHP source code that generates a document which
contains some javascript, and passes an object to that javascript using
JSON.

http://www.sined.co.uk/tmp/oltmans.htm

And here is the output it generates:

http://www.sined.co.uk/tmp/oltmans.php

Looking at these will probably confuse you, but might instead be of some
help.

Rgds

Denis McMahon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: website developers requirements
Next Topic: Aste - PHP template engine
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 15:16:06 GMT 2024

Total time taken to generate the page: 0.03839 seconds