35 questions
0
votes
0
answers
47
views
Get Value From JS
i wanna ask, how to get specific value from printed html ? example im grabbing website and load html with DOM, i need get value from js
video_bal=videojs('video-player');
video_bal.src(window.atob('...
4
votes
1
answer
988
views
WordPress Malware - Redirect to (fast.destinyfernandi.com) - even after scan and clean [closed]
I'm living my worse nightmare. I have an CentOS server, that is hosting 10s of WordPress website.
My clients notice that their websites are opening and after loading it is redirected to (fast....
0
votes
1
answer
1k
views
Create and edit file javascript with "file_put_contents"?
i would like to create a file.js with php but i think that in my code there are a lot of errors:
i have multidimensional array:
$report= array();
$report= array(array(3,6),array(4,8));
that is:
...
0
votes
1
answer
124
views
How to use phpjs mail function
how to implement phpjs mail function?
This is a little confusing to explain, so bear with me here...
Here my code:
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<...
0
votes
1
answer
199
views
PHP.js unserialize() error IE7
I try to serialize object data to be saved into a file by php using serialize package by PHP.js.
Chrome: fine
FF: fine
IE9: fine
IE9 in compatibility mode (essentially IE7): not fine.
Error from ...
1
vote
2
answers
654
views
Node.js to use external JS file?
Actually i'm using node-crawler under Node.js. Then i currently need to use the methods of PHPJS (An External Javascript File). How can i add or include that JS file into NODE.JS environment?
0
votes
1
answer
90
views
PHPJS' array_diff returns undefined
Example:
http://jsfiddle.net/7Cwbn/60/
I'm trying to use array_diff function from PHPJS to check if all of the elements inside selectedFeatures are found inside elem.features, but instead I receive ...
0
votes
2
answers
2k
views
Equivalent of array_unique and preg_split PREG_SPLIT_NO_EMPTY
I'm looking for the exact Javascript equivalent of php:
$tags = preg_split('/+/', $_GET['q'], NULL, PREG_SPLIT_NO_EMPTY);
$p = array_unique(array_map('strtolower', $tags));
sort($p);
It's almost done
...
2
votes
1
answer
2k
views
Integration with PHP.js Javascript library
I am attempting to integrate the PHPJS (http://phpjs.org/) library with some code and am having trouble calling any of the functions and the library's websites does not have a step-by-step for getting ...
4
votes
3
answers
2k
views
JavaScript construct equivalent to PHP's list()? [duplicate]
Possible Duplicate:
Javascript equivalent of PHP's list()
In PHP you can do assignment like this:
list($b,$c,$d) = array("A","B","C");
Is there anything like that in JS?
0
votes
1
answer
204
views
assigning global var to a php array accessed by jQuery post()
Im pretty new to jQuery (since a week) and don't understand why I can't assign the PHP (work.php) array to global var imgArrayThumbs. I'm calling an array of image names created by the php opendir ...
90
votes
2
answers
113k
views
nl2br() equivalent in javascript [duplicate]
Possible Duplicate:
jQuery convert line breaks to br (nl2br equivalent)
Currently I add <BR> for each evt.which == 13. Is there a nl2br() for JavaScript, so I can do away with this evt.which ...
6
votes
2
answers
3k
views
javascript equivalent to php unpack() function
I am looking for the javascript equivalent of php unpack() function? can someone direct me please.
Thanks!
16
votes
3
answers
16k
views
JavaScript equivalent of PHP preg_split()
Is there an equivalent of the PHP function preg_split for JavaScript?
2
votes
1
answer
14k
views
How to write a base32_decode in JavaScript?
I'm trying to create the equivalent of PHP's unpack. I've noticed the project PHPJS doesn't have it. I need it for the implementation of base32_encode and base32_decode (using Crockford's alphabet '...
5
votes
4
answers
71k
views
How can I use preg_match in jQuery?
Can I use preg_match to validate phone number in jQuery? Here is my code which does not work:
if (!preg_match("/^[0-9]{3}-|\s[0-9]{3}-|\s[0-9]{4}$/", phone.val() )) {
phone....
4
votes
6
answers
9k
views
array_count_values for JavaScript instead
I have the following PHP-script, now I need to do the same thing in JavaScript. Is there a function in JavaScript that works similar to the PHP function, I have been searching for days but cannot find ...
0
votes
2
answers
916
views
Read and write cookies
I have a javascript file linked to a PHP page which has a value that needs be saved for when a form is submitted and the page is refreshed.
Is there a simple way to set cookies similar to the method ...
18
votes
9
answers
55k
views
uniqid() in javascript/jquery?
what's the equivalent of this function in javascript:
http://php.net/manual/en/function.uniqid.php
Basically I need to generate a random ID that looks like: a4245f54345 and starts with a alphabetic ...
0
votes
6
answers
12k
views
file_Get_contents in javascript
i want to get data from other sites using javascript executed from my website.
0
votes
2
answers
1k
views
How can I write this PHP code in JavaScript
How can I write this PHP code in JavaScript?
I have no knowledge about JavaScript... :-s
<?php
$pozethumb=scandir("./pics/flori/thumbs");
$size=count($pozethumb);
$nrpoze=$size-2; ...
7
votes
3
answers
12k
views
Equivalent Javascript substr_count?
I am trying to find an equivalent function for Javascript. What I am trying to do is look for the current URL and if it has the following first part of the URL then do something.
In PHP I have this
...
2
votes
0
answers
270
views
JavaScript function that can produce same results as PHP function number_format [duplicate]
Possible Duplicate:
Format numbers in javascript
I'm in search of a JavaScript function that can produce the same results as the PHP function number_format(150000,0,',',','); is there a JavaScript ...
4
votes
6
answers
7k
views
str_shuffle() equivalent in javascript?
Like the str_shuffle() function in PHP, is there a function similar in shuffling the string in javascript ?
Please help !
0
votes
3
answers
2k
views
JavaScript Dates and Times
What is the JavaScript equivalent to the following PHP code:
$expTime = time() + (5 * 60 * 60); // now plus 5 hours (5 hour; 60 mins; 60 secs)
$expTimeStr = gmdate('Y-m-d\TH:i:s\Z', $expTime);
4
votes
2
answers
2k
views
Javascript equivalent of php's parse_url
I am writing a chrome extension that change part of the url in the current tab and reload the page with the modified url. I am wondering if there is a Javascript equivalent of the php's parse_url ...
1
vote
4
answers
183
views
JavaScript equivalent of this simple php
please can somebody let me know how to do the following PHP in JavaScript. The vaibles in PHP are Parameters in Javascript. If all three Parameters are set then I would like a PHP script to execute:
&...
72
votes
9
answers
44k
views
Javascript equivalent of PHP's list()
Really like that function.
$matches = array('12', 'watt');
list($value, $unit) = $matches;
Is there a Javascript equivalent of that?
0
votes
2
answers
6k
views
remove quotes from variable in javascript?
I really don't understand Javascript.
In PHP, I can remove quotes like this:
$tags_array = preg_replace('/"/', '', $tags_array);
How do I write it in Javascript?
0
votes
3
answers
220
views
Bogus char in Javascript testcase: all breaks
I'm using a JavaScript library called phpjs
The goal is to create functions that mimic how PHP handles them.
Here's one function in particular: http://phpjs.org/functions/is_float:442
I've written a ...
1
vote
1
answer
130
views
what are some cross-language libraries for people who know other languages (similar to phpjs)
PHPJS attempts to port php functions over to javascript.
http://phpjs.org/
Rationale: people who know php's functions really well can write javascript and just carry over what they know from php ...
1
vote
4
answers
1k
views
JavaScript equivalent of PHP's strpbrk function?
In PHP, I can use the strpbrk function to determine if a certain string contains a certain set of characters. Is there a way to do that in JavaScript?
TIA.
Edit: for those who may know JS but not ...
19
votes
5
answers
33k
views
preg_match_all JS equivalent?
Is there an equivalent of PHP's preg_match_all in Javascript? If not, what would be the best way to get all matches of a regular expression into an array? I'm willing to use any JS library to make it ...
286
votes
21
answers
373k
views
JavaScript equivalent of PHP's in_array()
Is there a way in JavaScript to compare values from one array and see if it is in another array?
Similar to PHP's in_array function?
6
votes
3
answers
14k
views
strptime in Javascript
I have a date input field that allows the user to enter in a date and I need to validate this input (I already have server side validation), but the trick is that the format is locale dependent. I ...